2d map editor in Open GL

User contributed sources that have become inactive, deprecated, or generally unusable. But ... we don't really want to throw them away either.
phycowelder
Posts: 74
Joined: Dec 19, 2007 6:55

2d map editor in Open GL

Post by phycowelder »

here is an openGL map editor, so you can zoom in out easily!
i intend on using this heavily.
i hope this sparks interest with some one else to!



its done the first stages!

features include
-a random path/river generator /W clean tile AI
-and a random tree planter and dirt patches
-UNWRAP_TILE.EXE makes the main 512x512 BMP into 16x16 bmp tiles for the utility.
-the Template BMP is only a basic design for setting up Chipsets that use my Mapping AI.

I'm going to add a few utilities!
-to shorten the tile requirements for the game/engine
-also to use either separate tile images or a master tile image
-also for FBGFX loading or OPENGL loading!
(i haven't tested it yet going to next, but i suspect that the open GL tiles are reversed on the Y-axis
so when i make the map formatting utility i have to switch those, maybe.)
-and a utility to choose loading mode fbgfx or openGL to walk around in!
-Tutorial/help PDF




Source:
MAP_GEN.zip
screeny:
Image
Last edited by phycowelder on Mar 01, 2008 7:07, edited 4 times in total.
DaveUnit
Posts: 239
Joined: Apr 20, 2006 15:47
Location: Central MA

Post by DaveUnit »

really neat little program here. the highlighted tile and the tile that is actually plotted gets thrown off though, probably from zooming. it'll say I'm at, for example, 17.5/20.5. weird.
still a nice program, I like the clean path option a lot. so many times I wish an editor had that.
phycowelder
Posts: 74
Joined: Dec 19, 2007 6:55

Post by phycowelder »

thnx! and ya a little weird ,wonder why!

i was thinking of adding a script section for random road/path,lakes/town squares, stuff that could easily be generated, also a flood fill area and undo 1-2 steps!

don't quite know how to do that yet, except maybe keeping 1-2 extra copys of the field map data in memory, and recall last move(old map)!

but a little later i think, i have to get my FB mustang for DR_D done tonight!
DaveUnit
Posts: 239
Joined: Apr 20, 2006 15:47
Location: Central MA

Post by DaveUnit »

for undoing you could make a queue of changes, like map(10,10) now uses tile 9 so you save what it used to equal, say 8, and when you hit undo it'll just reverse that one step and not hafta make a backup of the whole map. you'll just need to make a bit of script to say what the action was, and that might be a wee bit tricky.

oh and a feature request: animated tiles perhaps?
phycowelder
Posts: 74
Joined: Dec 19, 2007 6:55

Post by phycowelder »

ya but my ai queues half the map and undo some thing like that you would need almost a whole back up of the map, would you not?
DaveUnit
Posts: 239
Joined: Apr 20, 2006 15:47
Location: Central MA

Post by DaveUnit »

for something like that I suppose you would. but for simple changes my method would work.
phycowelder
Posts: 74
Joined: Dec 19, 2007 6:55

Post by phycowelder »

ya it would work! i guess i could make two types of undo!
UNDO =basic editing error
UNDO AI = AI mistake
phycowelder
Posts: 74
Joined: Dec 19, 2007 6:55

Post by phycowelder »

i was thinking animated tiles!
but then i was thinking that animated tiles would almost be better with a script engine instead of a mapping engine!

an idea i have been tossing to though is animated gifs for tiles! have to research that one
DaveUnit
Posts: 239
Joined: Apr 20, 2006 15:47
Location: Central MA

Post by DaveUnit »

well I'm making an engine right now that supports animated tiles. no scripting at all.
phycowelder
Posts: 74
Joined: Dec 19, 2007 6:55

Post by phycowelder »

may i ask your method? if you don't mind
cause aside from most static tiles water is 100% dynamic, and animation would be cool!
DaveUnit
Posts: 239
Joined: Apr 20, 2006 15:47
Location: Central MA

Post by DaveUnit »

well for every tile I break it down like this

I support tiles with multiple animations so first off a container containing all possible animations, I called it an Animset for the lack of a better term.

so from the Animset, there are possible animations sequences, which are groups of frames.

and finally the frames are nothing but uintegers with the value of the tile in the tileset to be drawn.

Animset->Anim->Frame->Tile

I will make a build of my engine with just code necessary to draw animations if you would like to look at it. it's not commented really but it shouldn't be hard to figure out. I'll post as soon as I finish it. shouldn't be too long.
Lachie Dazdarian
Posts: 2338
Joined: May 31, 2005 9:59
Location: Croatia
Contact:

Post by Lachie Dazdarian »

Hmm...in Dark Quest (yikes!) I did it like this. With tiles I wanted to animate, I placed the tiles in question in a row in the tiles files, one after the other. For example, if tile no.5 was animated, in the tiles file I would put its second and third frame (let's say we have 3 frames) on position 6 and 7. Then, in the map drawing routine I would check if a tile is 5. When found the program would draw the default or the alternative one, according to state on some other variable that loops (you know, with MOD).

Like,

Code: Select all

IF Frame1 = 2 THEN tile_to_draw = tile_to_draw + 1
IF Frame1 = 3 THEN tile_to_draw = tile_to_draw + 2
This is somewhat hackish, but with scripts you could save which tiles are animated and where their remaining frames are placed in the tiles file.
phycowelder
Posts: 74
Joined: Dec 19, 2007 6:55

Post by phycowelder »

ya that was what i was thinking! less coding for one tile, the script would handle all of it!
the script could check 4 a list of all water type tiles and replace when needed

EDIT:

OK i made an FBGFX map loader/viewer(really basic)
and it works just load y_max to 1, instead of 1 to y_max!

look perfect.
DaveUnit
Posts: 239
Joined: Apr 20, 2006 15:47
Location: Central MA

Post by DaveUnit »

well here's how I do things. I think it is very simple to make custom animations for sprites with it. The sprite class isn't in this demo but the engine in action is in the Sprite Engine thread in Game Dev if you haven't seen it.
Furthermore, I don't hardcode my animations like in the example, I made a .anim file type and a function to load them. I suppose that is a script though, but it really is nothing but a chain of simple numbers, nothing hard.

hopefully that shows that animated sequences are simple and can be implemented easily.

download source: http://www.mediafire.com/?jmiynyr7az2
phycowelder
Posts: 74
Joined: Dec 19, 2007 6:55

Post by phycowelder »

OK i put in some tile animation!
but it is in an animation script attached to the map,
just in case no one wants it implemented!
ill get a good walking demo version and show ya soon!

EDIT:
====new====
fbgfx_viewer.bas
fbgfx_viewer.exe
test.map
test.ani
(walker tiles)
(new animation tiles for the water)
i have added FBGFX_VIEWER to the files.
this allows you to view/walk around your map.
open EXE and type "test"
this map has animated tiles to look at, also in
fbgfx_viewer.bas has a little tut on making said
animation attachment.

Mapper.zip
Last edited by phycowelder on Feb 28, 2008 9:06, edited 2 times in total.
Post Reply