My Adventure Game Engine - Making Way For Adventure Engine 2
- Jasoco
- Inner party member
- Posts: 3727
- Joined: Mon Jun 22, 2009 9:35 am
- Location: Pennsylvania, USA
- Contact:
Re: My Adventure Game Engine (NEW DEMO ON PAGE 18! 6/10/10)
Oh, by the way, if you ran any of my demos before, DELETE THE PREFERENCE FILES first. That error is because I had Physics turned off before and it saved a config file with Physics set to false. Now it uses them so it sets it to true. My mistake. Just delete the config file.
- TechnoCat
- Inner party member
- Posts: 1612
- Joined: Thu Jul 30, 2009 12:31 am
- Location: Milwaukee, WI
- Contact:
Re: My Adventure Game Engine (NEW DEMO ON PAGE 18! 6/10/10)
I couldn't get it to run until I took it out of the love file.
Re: My Adventure Game Engine (NEW DEMO ON PAGE 18! 6/10/10)
I tested the demo, and
- Chucknorrisaurrus
- Prole
- Posts: 23
- Joined: Mon Jun 07, 2010 1:00 am
Re: My Zelda style adventure engine (DEMO NOW AVAILABLE)
@ Jasoco,
What's the method behind creating the map and creating collision detection with certain tiles?
What's the method behind creating the map and creating collision detection with certain tiles?
- Jasoco
- Inner party member
- Posts: 3727
- Joined: Mon Jun 22, 2009 9:35 am
- Location: Pennsylvania, USA
- Contact:
Re: My Adventure Game Engine (NEW DEMO ON PAGE 18! 6/10/10)
What do you mean?
My map currently uses a bunch of grids, i.e. multidimensional arrays, to store all the data.
Collision's: . for none, x for wall, w for low wall (i.e. a tile projectiles can move over)
Tiles come in 5 layers currently. The base layer, two lower decorational layers and two upper. With the player, NPC's, switches and other objects between the lower and upper layers.
Though I plan on totally revamping the thing. Ripping out decoration layers and replacing all decorations with what I will call "scenery". Hopefully I can get a method that saves a few frames and allows for easier map, or "stage" construction. The collision map will remain though for now at least.
Collisions are checked against the player's (Or other object's) x, y, x+31 and y+31 divided by 32 floored coordinates to the collision map. You can look at the code and find the "collision()" function for more info. I need to redo that though because of the problem mentioned above where Robin got stuck in the trees. The game "n" uses a method where it not only stores the collision values for each tile, but for its neighboring tiles as well all in the same grid space. If I use that method I should be able to fix that problem. Hopefully.
Either way, there is a long road ahead, and the progress depends on how much free time I get and how far Löve advances in the next few years and whether or not I can get a story in my head worthy of Cave Story recognition.
My map currently uses a bunch of grids, i.e. multidimensional arrays, to store all the data.
Collision's: . for none, x for wall, w for low wall (i.e. a tile projectiles can move over)
Tiles come in 5 layers currently. The base layer, two lower decorational layers and two upper. With the player, NPC's, switches and other objects between the lower and upper layers.
Though I plan on totally revamping the thing. Ripping out decoration layers and replacing all decorations with what I will call "scenery". Hopefully I can get a method that saves a few frames and allows for easier map, or "stage" construction. The collision map will remain though for now at least.
Collisions are checked against the player's (Or other object's) x, y, x+31 and y+31 divided by 32 floored coordinates to the collision map. You can look at the code and find the "collision()" function for more info. I need to redo that though because of the problem mentioned above where Robin got stuck in the trees. The game "n" uses a method where it not only stores the collision values for each tile, but for its neighboring tiles as well all in the same grid space. If I use that method I should be able to fix that problem. Hopefully.
Either way, there is a long road ahead, and the progress depends on how much free time I get and how far Löve advances in the next few years and whether or not I can get a story in my head worthy of Cave Story recognition.
- Chucknorrisaurrus
- Prole
- Posts: 23
- Joined: Mon Jun 07, 2010 1:00 am
Re: My Adventure Game Engine (NEW DEMO ON PAGE 18! 6/10/10)
[ten minutes later]
I get the gist of what you're saying, but I"m going to have to learn how to make multidimensional arrays, which are either a table of some sort or something else that is probably obvious but I cannot currently understand because I have completely burnt myself out by looking through your code.
Speaking of which, I went digging through your code for collision(), but I never found it. What file is it on?
I get the gist of what you're saying, but I"m going to have to learn how to make multidimensional arrays, which are either a table of some sort or something else that is probably obvious but I cannot currently understand because I have completely burnt myself out by looking through your code.
Speaking of which, I went digging through your code for collision(), but I never found it. What file is it on?
Re: My Adventure Game Engine (NEW DEMO ON PAGE 18! 6/10/10)
One way to do multidimensional arrays is to make a table containing tables.
Good bye.
- Jasoco
- Inner party member
- Posts: 3727
- Joined: Mon Jun 22, 2009 9:35 am
- Location: Pennsylvania, USA
- Contact:
Re: My Adventure Game Engine (NEW DEMO ON PAGE 18! 6/10/10)
It's easy. You just have to do each dimension one at a time.
You could probably keep going and make 3 dimensional arrays if you want. (One for the X, One for the Y and one for each tile type. I didn't think of this when I created the game so I have multiple two dimensional arrays instead of one three dimensional one.) I guess the only limit is the memory.
Actually, it's called checkCollision() sorry. It is in the engine.lua file.
Code: Select all
array = {}
for x=1,100 do
array[x] = {}
for y=1,100 do
array[x][y] = whatever
end
end
Actually, it's called checkCollision() sorry. It is in the engine.lua file.
- Chucknorrisaurrus
- Prole
- Posts: 23
- Joined: Mon Jun 07, 2010 1:00 am
Re: My Adventure Game Engine (NEW DEMO ON PAGE 18! 6/10/10)
Oh, I see, what this is doing is making a virtual field that is 100 blocks across and 100 blocks high, which you can use to fill in with strings or integers which can then be used to trigger events and such. This language is already teaching me more than any other language has! Thanks, I'm going to go try to make a sandbox.
Who is online
Users browsing this forum: Google [Bot] and 2 guests