Page 19 of 37

Re: My Adventure Game Engine (NEW DEMO ON PAGE 18! 6/10/10)

Posted: Fri Jun 11, 2010 12:19 pm
by TechnoCat
Picture 2010-06-11 08_19_27.png
Picture 2010-06-11 08_19_27.png (42.53 KiB) Viewed 3197 times

Re: My Adventure Game Engine (NEW DEMO ON PAGE 18! 6/10/10)

Posted: Fri Jun 11, 2010 5:00 pm
by Jasoco
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.

Re: My Adventure Game Engine (NEW DEMO ON PAGE 18! 6/10/10)

Posted: Fri Jun 11, 2010 10:57 pm
by TechnoCat
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)

Posted: Sat Jun 12, 2010 2:02 pm
by thelinx
I tested the demo, and :awesome:

Re: My Zelda style adventure engine (DEMO NOW AVAILABLE)

Posted: Sat Jun 12, 2010 9:41 pm
by Chucknorrisaurrus
@ Jasoco,

What's the method behind creating the map and creating collision detection with certain tiles?

Re: My Adventure Game Engine (NEW DEMO ON PAGE 18! 6/10/10)

Posted: Sat Jun 12, 2010 11:04 pm
by Jasoco
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.

Re: My Adventure Game Engine (NEW DEMO ON PAGE 18! 6/10/10)

Posted: Sun Jun 13, 2010 1:38 am
by Chucknorrisaurrus
[ten minutes later] :ultrashocked: :ultrashocked: :ultrashocked:

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)

Posted: Sun Jun 13, 2010 2:46 am
by Luiji
One way to do multidimensional arrays is to make a table containing tables.

Re: My Adventure Game Engine (NEW DEMO ON PAGE 18! 6/10/10)

Posted: Sun Jun 13, 2010 2:54 am
by Jasoco
It's easy. You just have to do each dimension one at a time.

Code: Select all

array = {}
for x=1,100 do
  array[x] = {}
  for y=1,100 do
    array[x][y] = whatever
  end
end
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.

Re: My Adventure Game Engine (NEW DEMO ON PAGE 18! 6/10/10)

Posted: Sun Jun 13, 2010 3:05 am
by Chucknorrisaurrus
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.