Thread: Level Editor

  1. #1
    Used Registerer jdinger's Avatar
    Join Date
    Feb 2002
    Posts
    1,065

    Level Editor

    You can download the level editor for my game here.

    From the main menu you can choose NEW or EXIT. The level loading functionality hasn't been written yet, so the LOAD button doesn't do anything.

    Still need to add the ability to save a level as well as the ability to choose different POW and Bot types (right now you're limited to one POW type and one Bot type). Also need to add ability to add tiles (barrels, crates, etc.) to give them something to seek cover behind and add some flavor to the levels.

    The final game will play something like chess except that each POW and Bot type will have unique attacks and maximum attack distance, etc.

    Now that the editor is starting to flesh out I plan to have a playable demo in about a month (though it will be limited to the 2 Bot/POW types shown here). Once I get that in it's alpha stage I'll probably take a few weeks to work on the art for some of the other POWs/Bots.

    Let me know what you think.

    **also, I'm going to eventually release the code as open source (right now it's up to 6,368 lines) but if anyone is interested in how anything was done or whatever just email or PM me and I'll send you the appropriate source.**

  2. #2
    Banned
    Join Date
    Jan 2003
    Posts
    1,708

    Thumbs up

    It looks good, keep up the good work!

    as a side note you didn't put it in a folder...i extract to my desktop and now they're all over the place

  3. #3
    Confused Magos's Avatar
    Join Date
    Sep 2001
    Location
    Sweden
    Posts
    3,145
    Originally posted by Silvercord
    It looks good, keep up the good work!

    as a side note you didn't put it in a folder...i extract to my desktop and now they're all over the place
    Who extracts zip files to the desktop??? Don't you have a folder C:\Cprogramming\DownloadedPrograms\ or something?
    MagosX.com

    Give a man a fish and you feed him for a day.
    Teach a man to fish and you feed him for a lifetime.

  4. #4
    I always extract things that I'm only going to use a couple times then delete to my desktop. It's easier to get to and delete. Usually zip files have a folder inside them, and when you extract, it just adds a folder for it to the desktop with the program inside. When you're done, just toss the folder. Very nice indeed.

  5. #5
    Crazy Fool Perspective's Avatar
    Join Date
    Jan 2003
    Location
    Canada
    Posts
    2,640
    Originally posted by Magos
    Who extracts zip files to the desktop??? Don't you have a folder C:\Cprogramming\DownloadedPrograms\ or something?
    i always extract to desktop. im not entirely sure why though... lol

  6. #6
    I am he who is the man! Stan100's Avatar
    Join Date
    Sep 2002
    Posts
    361
    Who extracts zip files to the desktop??? Don't you have a folder C:\Cprogramming\DownloadedPrograms\ or something?
    (Rolling on floor laughing)
    Stan The Man. Beatles fan

    When I was a child,
    I spoke as a child,
    I thought as a child,
    I reasoned as a child.
    When I became a man,
    I put childish ways behind me"
    (the holy bible, Paul, in his first letter to the Cor. 13:11)

  7. #7
    Used Registerer jdinger's Avatar
    Join Date
    Feb 2002
    Posts
    1,065
    Here's the updated level editor (zipped to unzip into a nice, clean folder just for SilverCharles.. I didn't realize it didn't zip that way the first time, sorry...).

    It has the ability to save and load a level (still restricted to a single level as I need to add a text box to allow the user to enter the level name.

    It is also restricted to the 2 first trooper types (1 POW and 1 Bot) but now includes their time-based animation routines (though I could probably afford to tweak the speed a bit and I need to put in a check to give it a natural pause for a few seconds between anims). Also, I want to randomize each troopers' pause between their anim cycles. Kind of make it more natural.

  8. #8
    Crazy Fool Perspective's Avatar
    Join Date
    Jan 2003
    Location
    Canada
    Posts
    2,640
    i click the .exe, screen flashes, thats it....

  9. #9
    Used Registerer jdinger's Avatar
    Join Date
    Feb 2002
    Posts
    1,065
    Are you trying to run it from the zip file or with all the files unzipped into the same directory? All the bitmaps, etc. have to be present in the directory you run the .exe from.

  10. #10
    Crazy Fool Perspective's Avatar
    Join Date
    Jan 2003
    Location
    Canada
    Posts
    2,640
    i unzipped everything into one directory and ran the .exe from where it was.

    edit: here is the log...

    SLED debug log file
    04/01/03 - 21:42:09
    -----------------
    Initialization start point
    dot.bmp loaded into video memory.
    21:42:09 - DirectInput object created OK
    21:42:09 - Keyboard device created OK
    21:42:09 - Keyboard data format set OK
    21:42:09 - Keyboard cooperative level set OK
    21:42:09 - Keyboard device acquired OK
    21:42:09 - Keyboard completely initialized successfully
    21:42:09 - Mouse device created OK
    21:42:09 - Mouse data format set OK
    21:42:09 - Mouse cooperative level set OK
    21:42:09 - Mouse acquired OK
    missle.bmp loaded into video memory.
    21:42:09 - Mouse completely initalized successfully
    text.bmp loaded into system memory (out of video memory).

  11. #11
    C++ Developer XSquared's Avatar
    Join Date
    Jun 2002
    Location
    Ontario, Canada
    Posts
    2,718
    Same error here:

    Code:
    SLED debug log file
    04/02/03 - 00:17:12
    -----------------
    Initialization start point
    dot.bmp loaded into video memory.
    00:17:14 - DirectInput object created OK
    00:17:14 - Keyboard device created OK
    00:17:15 - Keyboard data format set OK
    00:17:15 - Keyboard cooperative level set OK
    00:17:15 - Keyboard device acquired OK
    00:17:15 - Keyboard completely initialized successfully
    00:17:15 - Mouse device created OK
    00:17:15 - Mouse data format set OK
    00:17:15 - Mouse cooperative level set OK
    00:17:15 - Mouse acquired OK
    missle.bmp loaded into video memory.
    00:17:15 - Mouse completely initalized successfully
    text.bmp loaded into system memory (out of video memory).
    I'm running on a P3 1GHz, 512MB SDRAM, GeForce3 Ti500 /w 64MB DDR RAM.
    Naturally I didn't feel inspired enough to read all the links for you, since I already slaved away for long hours under a blistering sun pressing the search button after typing four whole words! - Quzah

    You. Fetch me my copy of the Wall Street Journal. You two, fight to the death - Stewie

  12. #12
    C++ Developer XSquared's Avatar
    Join Date
    Jun 2002
    Location
    Ontario, Canada
    Posts
    2,718
    You forgot to include text.bmp in the zip.
    Naturally I didn't feel inspired enough to read all the links for you, since I already slaved away for long hours under a blistering sun pressing the search button after typing four whole words! - Quzah

    You. Fetch me my copy of the Wall Street Journal. You two, fight to the death - Stewie

  13. #13
    Used Registerer jdinger's Avatar
    Join Date
    Feb 2002
    Posts
    1,065
    hehe. Yeah, I just realized that. I've been working on the road this week and wasn't able to look into it until this morning. Here's the corrected zip file with all the necessary bitmaps. Sorry guys, I was rushing to get it uploaded the other day before I hit the road.

  14. #14
    Crazy Fool Perspective's Avatar
    Join Date
    Jan 2003
    Location
    Canada
    Posts
    2,640
    looks good, are you using key frame animation??

    found a flaw though, try placing a charactor on the map, then place another above that one, the guy in the forground is blocked by the one in the background.

  15. #15
    Used Registerer jdinger's Avatar
    Join Date
    Feb 2002
    Posts
    1,065
    Originally posted by Perspective
    looks good, are you using key frame animation??

    found a flaw though, try placing a charactor on the map, then place another above that one, the guy in the forground is blocked by the one in the background.
    The algo for the animation is:
    Code:
    //CTileParser is a class that has all the RECT dimensions and 
    //offset points for each sprite's anim frame. It also has the 
    //delay time between frames for the current anim and whether
    //or not the current anim loops or cycles back and forth
    void CTrooper::Anim(CTileParser &ctp)
    {
    	if(bAnimate)
    	{
    		if((timeGetTime()-ulDelay)>ctp.GetDelay(this->iID))
    		{
    			ulDelay=timeGetTime();
    			if(this->CurFrm==0)
    			{
    				this->CurFrm++;
    				if(!ctp.GetLoop(this->iID)) bRecoil=false;
    			}
    			else if((this->CurFrm>0)&&(this->CurFrm<(this->MaxFrm-1)))
    			{
    				if(ctp.GetLoop(this->iID))
    				{
    					this->CurFrm++;
    				}
    				else
    				{
    					if(bRecoil) this->CurFrm--;
    					else this->CurFrm++;
    				}
    			}
    			else if(this->CurFrm==(this->MaxFrm-1))
    			{
    				if(ctp.GetLoop(this->iID))
    				{
    					this->CurFrm=0;
    				}
    				else
    				{
    					this->CurFrm--;
    					bRecoil=true;
    				}
    			}
    		}
    	}
    }
    The CurFrm var is a member var of CTrooper which is the ID of the current anim frame.

    Also, I fixed the problem with some of the sprites showing up on top of sprites that where below them. The sort algo was already in place but when I was debugging it I commented the call to the function out and didn't realize it wasn't uncommented when I fixed the other bug.

    Thanks for the catch, Perspective!

    I updated the zip file with the new *.exe that has the sort algo in place.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Replies: 19
    Last Post: 05-30-2007, 05:47 PM
  2. Replies: 12
    Last Post: 08-05-2003, 02:16 PM
  3. level editor
    By lambs4 in forum Game Programming
    Replies: 3
    Last Post: 10-31-2002, 05:35 AM
  4. PFE (prorgammers file editor, for Windows)
    By Unregistered in forum A Brief History of Cprogramming.com
    Replies: 1
    Last Post: 06-09-2002, 11:01 AM
  5. Level Editor
    By valar_king in forum Game Programming
    Replies: 11
    Last Post: 02-08-2002, 12:24 PM