Jump to content
A 2021 backup has been restored. Forums are closed and work in progress. Join our Discord server for more updates! ×
SoaH City Message Board

Game creator features


Blue Frenzy

Recommended Posts

I am creating eversong in c, so I developed my own tools to make the game. Those tools consists in a c programming library, a level editor and an object editor.

After finishing the game I am planning into releasing the tools so anyone could make his own game with this, with templates for a quick creation of the interface, with easy fuctions so the user should only program the behaviour of the objects, saving-loading game features, and another automated functions.

The best of this, is that it will help programmers to make all the data they need, like animations, sprites, levels and other, without having to know anything about the file system. They can start making his game now by coding the behavior of the main character.

Also it happens to be made in c, so, unlike other tools like multimedia fusion or game maker, you have all the power of c language, so you can do anything with it. There is no need of you to wait for someone to make an extension for your game. You don't have to deal with inner bugs, you can fix them yourself, anyone can do since it's open source.

Also, it will be ported into different systems. You can make games for windows, linux, psp, ds, gp2x wiz, pandora, wii... any system that has a compiler for c. If you don't have your system on it, as open source, you can overwrite the input and output functions and it is done, it works in your system.

And now, to do this, i need a great interface for the editors.

The level editor is a big grid where you can load a tileset of 32x32 tiles, and some lists that shows all the objects created. You have some options like:

-Hold alt to snap the object to the left-top corner of a 16x16 grid.

-Hold space to snap the object to the center of a 16x16 grid.

-Hold ctrl to draw a sensor object (an invisible square that you can give a behaviour)

-Press 1 to switch to layer 1 (behind, no collision)

-Press 2 to switch to layer 2 (behind, collision)

-Press 3 to switch to layer 2 (front, no collision)

-Hold shift to watch all the 3 layers to see how the final result will look

-Click over an object or sensor to select it.

-When sensor is selected, press up or down to change behaviour (identified by a number)

-Press left or right to change by 10.

-When an object is selected, use arrow keys to move 1 pixel.

-When nothing is selected, use arrow keys to scroll screen.

It also contains a pallete as foreground colour, so you can change it to make a good contrast between the tileset and the background. Also, a 4x4 big tileset. You can draw your tiles there and then, picking the block instead a single tile, you will draw the big tile. You can save 128 different big tiles.

I will later add a menu where you can create your animations and objects.

An sprite consists in different animations. Each animation uses different frame at a fixed speed. A frame has an image, a hotspot and an action point. You can define those ones by selecting the frames from the images folder.

An object has an sprite and a name.

So, how to improve the editor? What else should I add? how to change the interface to make it better? What would YOU like to see in a game editor?

Any helpful idea is welcome.

http://img128.imageshack.us/img128/2916/picu.jpg

Link to comment
Share on other sites

This looks like it has the potential to be an awesome engine. I myself am in the midst of learning C# right now, so this is something I might be interested in.

There are a few more things I'd like to know about the engine:

- Which kinds of sound/music files does the engine support?

- Can Layer 1 support multiple scrolling parallax backgrounds?

- Is there a way to limit the palette for games? For example, if I wanted to set the game's palette limit to that of the Sega Genesis, could the engine do that?

-How well can this engine handle time-based events?

-I see that your engine can produce sensors. Does the engine also have the potential to create sensors and/or hit-boxes for objects and enemies?

-Currently, how often has your engine crashed?

This engine looks like it'll be great. Can't wait to see this completed. :)

Link to comment
Share on other sites

- Which kinds of sound/music files does the engine support?

Actually it uses wav, but it can use any kind of file, simply by using the right lib. Im planning on include midis, ogg and mp3. Maybe if i start learning how mods are, I could include them too.

- Can Layer 1 support multiple scrolling parallax backgrounds?

Layer 1 is for the ground itself. For example, if you want to draw trees, bushes, and other decorative on untouchable elements. Parralax, now is a different system and works different, appart. So, you define a parralax or bg image and after that, you draw the ground. The current system only supports 1 layer for parralax, but it sounds a great idea to add multiple layers. Thanks for the sugestion.

- Is there a way to limit the palette for games? For example, if I wanted to set the game's palette limit to that of the Sega Genesis, could the engine do that?

You can use the picture formats bmp, gif and png, the last 2 including palletes. The engine is built in over another graphic library, so you can use whatever the lib has. Actually the nds compilation uses the pallete system as default because of memory limits.

Else, if what you want is to change palletes, i created a replacing colour method for a whole sprite.

-How well can this engine handle time-based events?

There are two ways of using it: by frame count and by

using the time.h lib.

My own game has frameskip so frame count usually works for this.

But it'd be a great idea to have an inner clock with easy functions.

-I see that your engine can produce sensors. Does the engine also have the potential to create sensors and/or hit-boxes for objects and enemies?

Yeah. The method is simple. You just have to write:

create_sensor(x,y, width,height, behavior_id);[/CODE]

And it returns the pointer to the sensor.

If you want to relate objects, you can do it. Unlike mmf, you can make a chain of objects relating themselves, so you don't have to search for an specific object. So for example, if you want 2 object to work paired (for example a laser shooter and the laser object itself) you have a reference property named "related"; When The lazer shoots you can write :

[CODE]shooter->related= create_object(shooter->x, shooter->y, LASER_OBJECT_ID);[/CODE]

So you can for example, destroy the object without having to search for the laser object:

[CODE]destroy_object (shooter->related);[/CODE]

You can do it for example with blocks. Imagine you code the behaviour of the sensor number 0 to act like an obstacle and you have a rock object that you want to make it to work like an obstacle.

You can do:

[CODE]rock->related= create_sensor(rock->x, rock->y, rock->width, rock->height, SENSOR_ID_0);[/CODE]

Then, if you move the rock, for example, by being pushed, you can do:

[CODE]rock->related->x= rock->x;
rock->related->y=rock->y;[/CODE]

Anything can be created at runtime, and any object can be assigned to another object. Maybe this seems hard if you don't have a good idea of how to code in c, but trust me, it's easy as hell and very powerful, because you can make chains like:

[CODE]object->related->related->related->x;[/CODE]

or even more complex but powerful: imagine a flying bird with countless orbs moving arround him to protect him against attacks:

[CODE]ObjectBase* orb= bird->related;

while (orb != NULL)
{
//do orb behaviour here
orb=orb->related;
}
[/CODE]

Is it quite hard? if you know how to code in c, this should be as easy as peeing.

[CODE]-Currently, how often has your engine crashed?[/CODE]

Never. It just crashes when a file is not found during loading time. OBviously, it crashes if your code is wrong, like null pointers, division of zero and else. But obviously, this doesn't depend on the lib but on your programming skills.

Link to comment
Share on other sites

The image link in your first post doesn't come up. =[ working now

Anyways, I think it's a great idea to release the editor you've made. Some people may find it a good resource to make a game with, and for others it could prove as an example to help learn C and Allegro from.

My only comment is just to say you should probably keep it in your best interests to write down every function you've made and list the variables it takes and short descriptions of what each one does.

Link to comment
Share on other sites

I strongly recommend that you release such a program. This could answer most of my own questions about C.

Honestly, I've put thought into it, and I really want to try understanding a different programming language, with out having to use something like Game Maker to lag my computer to death.

Link to comment
Share on other sites

Can you tell me what is that? I can easily make a colour swap, even i could make a fast one that swaps colour just when It's about to be changed. But I don't know what is the effect you are talking about.

Look that in my game, eversong, the main character's armour and shoes colour changes depending of the equip. Also, the gfx lib let's me make tinted drawings, like drawing a sprite turning green or white. You can aslo have add and substract blendings.

But making a megaman game like is damn easy.

Link to comment
Share on other sites

It's kind of easy to do. Just a replace colour method.

Since it's you, I could make a realtime pallete swap, but it'd be easy as hell as long as you have the pallete values.

The music input depends on the platform you want to use it. Actually it's c and you can do anything, but for depending on what platform you want to play the game, you have to code it or not.

I am using wavs for every platform as default, but playing mp3 or ogg is damn easy to code for pc, but still, if you are coding it for pc, you won't have lacks of memory if playing a wav instead. Anyway mp3 and ogg will be done by default.

To code wall slide is as easy as in mmf. Playing with the object values : x, y, speed and gravity, and placing sensors arround, you have it done.

Link to comment
Share on other sites

Just basics to code AI. Do you know any programming language? It's symilar to game maker scripts, but much more powerful. If you wish, you can also betatest it when done so you can practice. If you code engines in mmf it should take like 1 week to fully understand how to code in c. That's what it took for me. If you are planning moving from tools to code, this is a middle step.

It uses templates so, you don't have to know about compiling or advanced options. It's designed for new people to enter in the programming world and to experts to don't have to code the most heavy part.

The template has this code:

void main()
{
    init_game_engine();
    currentLevel=0;
    while(1)
    {
        play_game();
    }
}

Kind of easy. With this, the game plays automatically. Any level created with level editor works. But obviously, objects in screen won't do anything. You have to code thebehaviour. Very much like the mmf events, but instead of selecting the options from a menu, writing it down.

if( test_collision (obj1, obj2) )
{
    obj1->speed =obj1->speed +1;
}

for example, it's symilar to:

+obj1 collides obj2
-obj1 add 1 to speed

  • Like 1
Link to comment
Share on other sites

Oh, I could help you. I won't teach you, you should find a book or an online tutorial, but I will explain to you what you don't understand.

Start with this. I use code_blocks as default template. Here you can start writing your own code.

http://www.cprogramming.com/code_blocks/

Try a hello world application. Create a console application in c (not c++).

and try this:

http://www.cprogramming.com/tutorial/c/lesson1.html

If you have any question, ask me. It'll be a bit confusing at the beginning, but when you understand basic concepts like functions, strings and pointers, you will understand it all. Make every example show. You learn through practice, not by studying.

Link to comment
Share on other sites

C is a good start. After all, c++ is an evolution of c. Learning the basics in c should let you learn c++. Everything in c++ uses c. You can even code c in c++ applications and change any aplication into c++ just by changing the file extension form .c to .cpp. To say it simply, c++ adds things to c. That is not a true statement, but unless you are an expert who wants to get in the inners of the coding it should be true.

I recommend you to start with c since it's a structured programming language and you can learn a lot about functions, pointers, variable declarations, data structures and everything basic for programming. Once you know how to program in any language you can switch to object-oriented languages and play with the new posibilities. Just a sugestion, just do what you want to do.

Link to comment
Share on other sites

This all seems like a great undertaking Blue Frenzy, and it's nice to see someone building an engine with a "real" programming language. Looks like this could be going places real soon. Hope this would allow for cross-platform compatibility too. However there is the matter of one issue.

void main()
{
    init_game_engine();
    currentLevel=0;
    while(1)
    {
        play_game();
    }
}

void main()?

...

No. No. And no.

void main() is just blasphemy in the name of all that is good! Other than that, I can't wait to try this myself. It should do just dandy for me. I know lots of C++, so it won't be much trouble at all to use. I just can't stand C-style strings. Anyway, looks good, keep up the work.

Link to comment
Share on other sites

Yeah, you are right, but think that this is a template for begginners.

int main(int argc,char *argv[])
{
    init_game_engine();
    currentLevel=0;
    while(1)
    {
        play_game();
    }
    return 0;
}

That is a quite complex code for someone who is starting to understand c code. A new c programmer could be confused about the meaning of (); while(1) or void, but if you skip those you identify: main->init engine->the first level is the number 0->playing game.

Instead if you add those much, there is a lot of information you can miss. That's why I simplified the code.

Anyway, I am trying to do it with multiplatform compability. Just changing the template should allow you to compile for different applications. I will do it for windows first, and then I will probably try it for gp2x wiz, pandora, psp and nds. I also have in mind linux and mac.

The idea is to create a new project for the desired platform, import the graphic library we want to use and then import my lib. Overload the functions in the inputOutput.c to use the lib methods and it's done.

If you want to check it, when I have it done I will release a beta testing copy. It will allow you to start creating levels and animations before the final version is released.

Nowadays, I have the Animation editor finished: the 1st of the 3 tools:

Please, tell me now how can I make this better.

-Animation editor

It allows you to create the animations. The game uses a directory as default storage for images. It automatically reads the images in the folder and builds an structure based on the file name:

<sprite>x<animation>x<frame>.bmp

So, for example, "122x2x0.bmp" is the first frame of the animation number 2 for the sprite number 122.

The animation editor saves the information for all those frames. It loads everything. You can define the default speed for an animation and the hotspot and the action point of every frame. You don't even need to do this if you want. By default all the images have the hotspot and the actionpoint at the topleft corner of the image. Exactly like in mmf. Also, the default speed is 0. It won't crash if you miss to position an animation.

pictp.jpg

-Object Editor

The object editor let's you to create objects for the aplication. It has 3 different list of objects:

-Hazard list: Those are the objects that you can add into the level.

-Enemy list: Those are just like hazards, but instead the have aditional parameters and they are being grouped.

-Particle list: Those objects doesn't apear in the level editor. The only possibility of using this objects is by creating it through behaviour code. Those elements doesn't exist at the level build and dissapear after a new level is created. You can put here bullets, special effects or even small parts of an enemy's body, whathever is created during runtime, not during level load.

The object editor let's you to create a list of objects that is loaded in the level editor and in the game. You can create his class(particle, hazard, enemy), assign a default sprite and various default values, like transparency, alpha blending, default angle, number of behaviour values (like the alterable values in mmf), a name and the AI behaviour identifier.

Still working with it. I need to load and save the created objects to finish the editor.

-Level editor

The level editor let's you to create levels to be read by the game. The level shows a grid with all the levels you have saved. If you click on an empty frame, the new level screen will shown up and you can fill the information of the level: tileset, background, size in number of tiles.

In the level you have 3 different layers and you can place any object created with the object editor, place sensors and everything you need to build a level.

The tiles are automátically read from the tiles folder. In a folder you find the 32x32 tiles. Thery are inside of another folder named like this:

ti<tile id>_<variation>

for example "ti0_0" is the folder for the tileset 0 in the variation number 0.

Variation is done through code. By default is always 0. If you change the variation, the level will load with the variation assigned.

For example, if we create a level with the tileset 0, but we want to make that level you have different situations for the level, like in angel island after the forest is burnt. We have the ti0_0 as the tileset for the green forest and the ti0_1 as the tileset for the burnt forest. So, with this you don't have to create a new level with a new tileset, neither block your path backwards. or duplicate the level with a new tileset. just change the variable and it will load the same level, but with the variation of the tileset.

I use this feeature in eversong for daytime where ti0_0 is daytime, ti0_1 is sunset, ti0_2 is evening and ti0_3 is sunrise.

Inside the folder, the tiles are named:

<tile number>.bmp

so the tile can be "0.bmp" or "1.bmp"

The tile 0 is always transparent and it's skipped when drawing the level, so there is no matter what tile you put there.

The system lets you to add up to 256 tiles. More than enough. You can also build your 128x128 tiles.

The level editor still needs to be adapted to the new tools.

Once you save the level, in the game just change "currentLevel" value and it will load whatever you saved into that level.

Link to comment
Share on other sites

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...