hi, hmm., in 2d square/diamond tile games.., level editor comes first.........

Started by
9 comments, last by mickey 21 years, 11 months ago
before the game engine so that you wouldn''t put the codes in like making codes to map all the tiles onto the screen directly into your code right? so what you would do is., make a level editor then make a file format for this, then later on, on your game engine, put in a function that loads this level of yours made by your level editor. is this right? btw, how does someone make a level editor? is this just really simple to made? is this what comes with some of the commercial games like Arcanum etc., ?
http://www.dualforcesolutions.comProfessional website designs and development, customized business systems, etc.,
Advertisement
in theory you could code either one first, but I usually start off with the level editor.

what language are you coding in, if you're using delphi I'll give you the source to one of my 2d tile-based(16x16x64x64 tile & map size) level editors

The idiot in the box

[edited by - idiotbox15 on May 3, 2002 7:51:35 AM]
aww, am using C...,

well anyway, can you say something about how does someone makes a level editor? hmm., probably the requirements of your level editor would narrow it down? ie, how will i save the map in which my game engine would understand? is it in a struct etc.,?

thanks,
http://www.dualforcesolutions.comProfessional website designs and development, customized business systems, etc.,
I just use a simple array and put it inside a record, and in delphi file I/O with records is simple, I''m not sure how you would do it in c/c++ but this is how it looks in delphi code.


//Map Structure

Type
Tmap = record
Tiles = array[0..64,0..64] of integer
end;

//declare a map variable
var Map : Tmap;
// I think this would be somethin like "#Define map as Tmap" in c


//procedure to save the map to a file
procedure Tform1.savemap(Mapfile : file of Tmap; Filename : string;
begin
AssignFile(mapfile,filename);
reset(mapfile);
write(Mapfile,map);
end;
end;

I hope this helps a little bit, I''ll try to find out what this code would be in C for you.
Goto www.planetsourcecode.com and search for Zelda in the c/c++ archives and you should find an open source game called Zelduh, it has the source to the game and Level editor in Msv c++, it might help.
I wrote the engine first.
I tested it with a hard-coded level.
then when I got to the level builder, I built it using the game engine and got a level editor + level player
cheers


I am what I am, more or less
and my site rocks
www.geocities.com/roam_fire
I think
I am what I am, more or less :)and my site rockswww.geocities.com/roam_fireI think
That''s how I did it for prelude to darkness, the editor and game were build at the same time, the editor is just a subset of the actual game. Multiple editors were build into the game at different points, i.e. the terrain editor came first, the a mesh editor, then a building editor, then a creature editor.

luck,
-m

mat williams
Lead Programmer, Designer
Zero Sum Software
www.zero-sum.com
mat williamsLead Programmer, DesignerZero Sum Softwarewww.zero-sum.com
hiya,

thanks for the replies guys! one last thing., not about this thread anymore i just don't want to start another one...,

is it really like this.., I should load all my game graphics unto the video memory using the API i want before my game starts? what if i run out of memory? i mean, it's very easy to consume all the memory ye know...,

so for example, I have all these things happening on the game screen at one time..., 10 enemies, with 20 frames each onto them, 4 640x480 backgrounds, 5 kinds of weapons with 5 frames for each, shall i Load this everthing onto the memory?? yikes!

thanks for sharing you side guys..,


[edited by - mickey on May 8, 2002 11:23:53 AM]
http://www.dualforcesolutions.comProfessional website designs and development, customized business systems, etc.,
you really think that''ll fill up the video of an almost modern-day card?
let''s have a look at the parts and sum up, ok?
i''m assuming you''re using a ~64x32 tile and 16bit resolution

1) 10*20 = 200. let''s say each enemy is even 100x200px.
that''s 200*100*200*2 bytes = 8,000,000 bytes = 7.6mb

2) 4*640*480*2 bytes = 2,457,600 bytes = 2.3mb

3) let''s say your weapons are even 40x20px.
5*5*40*20*2 bytes = 40,000 bytes = 39k.

you''re also forgetting whatever tile graphics you may have.
but without the tiles you have about 10mb here.
i''m assuming that any API worth using, has a way to attempt to create a surface in video memory, and of retruning unsuccessful.
thus you should probably be able to check if you succeeded putting something in video memory.

also, those 4 backgrounds, unless you need them constantly, keep only 1 or 2 in video memory.
like, your title screen doesn''t need to be in video if it''s hardly ever used.

speaking for directdraw, i think a primary surface''s backbuffer goes into system memory even though the primary itself is in video memory but i''m not sure..

//Demiurge
Make something idiot proof, and someone will make a better idiot..
//DemiurgeMake something idiot proof, and someone will make a better idiot..
kewl! hmm.,

how about diablo2? did you think the guys load everything up from the start of the game? i mean, unlike diablo 1 which for every level you descend, a map loads right, but in diablo 2, there no laoding till you get to the next part... any ideas how is this thing done? multithreading?

thanks,
http://www.dualforcesolutions.comProfessional website designs and development, customized business systems, etc.,

This topic is closed to new replies.

Advertisement