Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

Work in Progress / MapScript V1 - Entity system for game levels

Author
Message
Zotoaster
19
Years of Service
User Offline
Joined: 20th Dec 2004
Location: Scotland
Posted: 8th Nov 2006 22:38 Edited at: 8th Nov 2006 23:01
This isn't exactly a program of game, but an aid to help you develop your games (DBPro only) and I'm finding it very useful in my current project.

What it does
It creates map data that can easily be loaded into your game.


How does it do it?
The map data can be stored in a text file (which can be made in notepad or anything you wish). It consists of commands that load objects and alter them in anyway you wish, and once they've been loaded into your project, they can then be controlled however you like. The map can simply be imported into DBPro by calling the function:
name$=loadMap("MapName.txt")
(the name of the map is returned, but you obviously don't have to get it)


What does the data look like?
As I said, it's simply like a programming language, but not like DarkBASIC or any of the sort, here's an example of creating a sphere:


This will obviously create a sphere, at a certain point in 3D space, with an angle and size. There are extra commands for texturing and stuff.


What's the point when there's the DB commands?
Well, imagine making your game, and you need to change lecvel many times, it's a pain doing it like this:


Which could go on forever, when you can just do this:

And that's the whole level changing bit done.

Now you may be thinking, "but you have to make lots of code in the text file anyway". Well, with this it is possible to:
1) Make your levels dynamic
2) Make your game modable
3) Make an editor which exports the code
4) Above all, keep your game code organised



Commands and Syntax
I already showed you one example of a command, here are them all, incase you're interested.


And that's them all so far. You may have noticed to set an entity's alpha, reflection or texture, you have to number it, well, for that you just count down through the entities.


The functions
There are many functions used for this, but you will only need a few:



Example Program
Here's an example program for you, which comes with the functions and the script for a map, don't ask me what it's ment to be, because I don't know

DBPro Code + Functions:



MapScript Code



Last Words
You can put comments in your code just like you would in DarkBASIC. The prefixes for the remakrs are // , ` and rem.

Finally, I would urge you to use this. It really takes the strain away from creating levels.

Enjoy



[edit]
On a further note, don't think this is just for Maps, I'll be using this for positioning health packs, guns, enemies, all of that.


[edit again]
Once I get my new computer I'll be able to add functionality for shaders. Meanwhile, I might just start making a level editor for this


[edit again]
Also, please tell me if you use it. You don't have to credit me (which would be nice ) but I'd be interested to know if it's popular and if I should expand on it more. Come to think about it, comment about it while you're here (please)

Profit
18
Years of Service
User Offline
Joined: 19th Feb 2006
Location: United States
Posted: 9th Nov 2006 00:46
Nicely done Zotoaster. I commend you.

common people are walking in line.

Mitsu Fly Ride.
Chris Franklin
19
Years of Service
User Offline
Joined: 2nd Aug 2005
Location: UK
Posted: 14th Nov 2006 20:37
Coll stuff more toast any updates?

Zotoaster
19
Years of Service
User Offline
Joined: 20th Dec 2004
Location: Scotland
Posted: 14th Nov 2006 22:15
I made an editor for it, just check around WIP. There have been a few added commands. I might make more of it soon.

Airslide
19
Years of Service
User Offline
Joined: 18th Oct 2004
Location: California
Posted: 19th Nov 2006 19:55 Edited at: 19th Nov 2006 20:23
Thanks, this will be perfect in my game, and I think I can easily make an editor export the code!

EDIT: One suggestion, prehaps you could rename your freeObject() and freeImage() functions to freeMapobject() and freeImageobject()? I'm already doing it (not hard at all) but it would make it easier to intergate new releases into my engine without having to rename them over and over, since my project already has these functions, just a bit diffrent.

Zotoaster
19
Years of Service
User Offline
Joined: 20th Dec 2004
Location: Scotland
Posted: 19th Nov 2006 22:43
That's a good point. Also, somewhere here in WIP, you can find an editor that I just made for it. It's what I'm using

Airslide
19
Years of Service
User Offline
Joined: 18th Oct 2004
Location: California
Posted: 20th Nov 2006 03:53
I tried that, its pretty nice, the only thing I need is the ability to load in a terrain and place the objects accordingly with some sort of grid allignment and prehaps a feature to set to the terrain height of the object position.

Login to post a reply

Server time is: 2024-09-29 18:30:20
Your offset time is: 2024-09-29 18:30:20