Best 2d game dev practice

Questions about the LÖVE API, installing LÖVE and other support related questions go here.
Forum rules
Before you make a thread asking for help, read this.
Post Reply
akira
Prole
Posts: 9
Joined: Sun Mar 07, 2010 5:23 pm

Best 2d game dev practice

Post by akira »

I'm in the process of building a sort of 2d game base, in the same graphics style as that of Rpg maker VX however not in ruby, and not pre compiled.
I;m having issues in the dev, part of it, more with map creation/management and map swapping,
I would like opinions on the best practice for making something like that.

I'm NOT asking for you to make any code,
I AM asking for an opinion on the best possible rout when building.
Just clarifying.

Thanks, Akira. ^^
User avatar
kikito
Inner party member
Posts: 3153
Joined: Sat Oct 03, 2009 5:22 pm
Location: Madrid, Spain
Contact:

Re: Best 2d game dev practice

Post by kikito »

Short answer - it depents.

Mostly on how much experience you have! Have you done any game programming before? Also the familiarity you have with the tools you will be using (which by the way you didn't mention... you just said the ones you would not use, if I understood correctly).

For designing maps, the simplest approach is using an already built, external tool. Some people are using Tiled and seem very happy with it.

Concerning the "map management" part, well, if you are using an interpreted language, such as Lua (like LÖVE does) then loading a map can be as simple as loading a source code file (the maps are encoded directly in Lua).

In order to swap one map for other, you have to "destroy" the first one first. This usually involves destroying each of its tiles individually (with a loop) and all the entities, objects etc on the map. If the player is supposed to "come back to the map" later, then you will have to save, at least some things - like "this door was opened" or "this monster was killed".
When I write def I mean function.
User avatar
Jasoco
Inner party member
Posts: 3725
Joined: Mon Jun 22, 2009 9:35 am
Location: Pennsylvania, USA
Contact:

Re: Best 2d game dev practice

Post by Jasoco »

Maps load as you go. My maps are done in two parts. The first is a plain text file with numbers and characters to tell the engine what tiles go where. The second is a postscript Lua file that can perform stuff in post after the map is loaded, like adding hotzones or enemies to defeat. Since it's Lua, you can do whatever you want. It is loaded second.

Stuff like switches and doors that need to stay activated need to be stored as globals and saved to be loaded when saving the game.

It's more complicated than that. I've been working on my Adventure Zelda style engine for a while. And it's far from finished. But it has come a long way.
akira
Prole
Posts: 9
Joined: Sun Mar 07, 2010 5:23 pm

Re: Best 2d game dev practice

Post by akira »

kikito wrote:Short answer - it depents.

Mostly on how much experience you have! Have you done any game programming before? Also the familiarity you have with the tools you will be using (which by the way you didn't mention... you just said the ones you would not use, if I understood correctly).

For designing maps, the simplest approach is using an already built, external tool. Some people are using Tiled and seem very happy with it.

Concerning the "map management" part, well, if you are using an interpreted language, such as Lua (like LÖVE does) then loading a map can be as simple as loading a source code file (the maps are encoded directly in Lua).

In order to swap one map for other, you have to "destroy" the first one first. This usually involves destroying each of its tiles individually (with a loop) and all the entities, objects etc on the map. If the player is supposed to "come back to the map" later, then you will have to save, at least some things - like "this door was opened" or "this monster was killed".
Yes i have done game programming before, but that was for Ruby+rpg maker VX. it was fun, but never anything i would release, it just wasn't very professional.
Jasoco wrote:Maps load as you go. My maps are done in two parts. The first is a plain text file with numbers and characters to tell the engine what tiles go where. The second is a postscript Lua file that can perform stuff in post after the map is loaded, like adding hotzones or enemies to defeat. Since it's Lua, you can do whatever you want. It is loaded second.

Stuff like switches and doors that need to stay activated need to be stored as globals and saved to be loaded when saving the game.

It's more complicated than that. I've been working on my Adventure Zelda style engine for a while. And it's far from finished. But it has come a long way.
Hmmm... thanks for the advice, ill try and work something like that in



Thank you, i think i may have an idea of how ill be able to make it, but only an idea... sadly.
Post Reply

Who is online

Users browsing this forum: No registered users and 132 guests