World editors.
jason perkins

Whenever I read about professional games and how they make them. It sounds like most of the programming being done is designing classes, and coding the software that builds a world editor of sorts that makes the game.
Something that you could place tiles, objects, enemies, npcs, how they interact, and pathing on. So the question is, are there any good articles/tutorials around that show how to code these.

Onewing

Professional developers have a lot of editors they use. Often times, they'll pay for third-party software so they don't have to develop the tools themselves (meaning other companies are just creating the editors and such).

For learning it yourself, I'd say the best way to go about it is:

1) Open an editor like Mappy
2) Play around with it
3) Write down your ideas of how to duplicate it via programming
4) Share with us (or any other game developing forum)
5) Look at some pr0n
6) Be told how your doing it wrong (uh, referring to step 4)
7) Learn
8) Do
9) Profit!

All steps are optional.

Sol Blast

With a only a little tinkering around that takes on whole new levels :P.

Quote:

1) Look at some pr0n
2) Play around with it
3) Write down your ideas of how to duplicate it
4) Share with us
5) Be told how your doing it wrong
6) Learn
7) Do
8) Profit!

Anyway. OT.
You're right that most modern engines will do things by setting up tools that. An important part of said tools is an engine-binded scripting language like LUA. Most engines do things this way nowadays. It'll allow you to edit objects, code AI, paths etc without editing your engine code.
Here's GameDev's articles on scripting. I recommend this one.

ITAmember

If you're doing something like a rts game would several text files with a bunch of varibles for the program be enough? It would store things like AI weights, maps, unit attack and defence ratings, so on so on. Think it would be a bad idea?

Biznaga

Sorry if I go a bit off-topic: I find Lua's coroutines very useful. Do you know about any other scripting language that supports them. I looked for something similar in Python and Ruby, but failed.

As for coding a world editor, I left behind any hope about doing it in C/C++. I wouldn't doubt coding it with Java or C# for productivity sake.

Sol Blast

A text file would certainly work for unit attack and defence ratings. But you'd be better of using XML or something for large sets of data.

As far as anything AI goes, I definitely don't think text files would ever come close to being adequate for the task. Not unless you got really handy and more or less made your own engine embedded scripting language.

jason perkins

Well Mappy seems to make alot of things possible that I wouldn't dream of without spending months on a project and sorting through thousands of lines of code. But, it looks hard to start seeing as its not nearly as well documented as allegro/directx/opengl. It hardly seems worth making one yourself though seeing as these free editors already exist and can make a wide variety of games. There's 5 vastly differant types of demo games on their website. looks through gimp tutorials to figure out how to draw

Onewing

That's why I was saying there are the people who buy/use editors and those who make them. It's worth you're time if you want to be part of the latter group. If you're just wanting to design/develop games, professionally or not, might as well just find an editor that can accomplish your needs.

jason perkins

Has anyone tried mappy here? I can't get any of their source examples to compile. the readme says to do this...

Just double click or run buildal.bat to make the examples using DJGPP (DOS)
or buildalm.bat for Mingw32 (DevC++ counts too) (Windows)
(if you are compiling with Visual C you'll have to do it yourself).
Use cursor keys to scroll on examples and ESC to exit.

-These batch files don't seem to do anything. I don't have a 'mappyal.o' file anywhere.

C++ notes: MappyAL will work fine with C++, but the file 'mappyal.c'
must be compiled as 'C'. With MSVC there is no problem as it uses
the filename extension (.c/.cpp) to determine how to compile, but
IDE's like DevC++ and VIDE don't do this with C++ projects, so
instead of adding mappyal.c to your list of sourcefiles (like with
MSVC) be sure you have mappyal.o by running 'buildal.bat', or
manually compiling with:

gcc mappyal.c -O2 -Wall -c -o mappyal.o

then adding mappyal.o BEFORE -lalleg in the linking options, with
DevC++ select Project:Project options (Alt+P) and click 'Load object
files' and add mappyal.o, now move the -lalleg text so it is after
the object file, it should look something like:
C:\mapalr11\mappyal.o -lalleg
do not add the file mappyal.c to your sourcefile list

sigh, its a mouthful I figured I'd ask. I assume this '-lalleg' is what they figure my allegro library is called, but its liballeg.a... I'm confused :(
I use Dev's c++ I figure I'm probly best off trying a differant compiler with this.

Edgar Reynaldo

It's not the compiler that's broken, it's Dev-C++. Building them with MinGW should work fine, but you probably don't have your compiling environment setup properly.

Your path variable should include the directory to mingw\bin, wherever that is with your dev-c++ installation.

set PATH=c:\devcpp\mingw\bin;%PATH%

Quote:

I assume this '-lalleg' is what they figure my allegro library is called, but its liballeg.a... I'm confused

When you link with the -l flag, it looks for a .a archive file with this naming convention : '-lname' looks for libname.a .

Quote:

These batch files don't seem to do anything. I don't have a 'mappyal.o' file anywhere.

What did running buildalm.bat say? Post the output after you've fixed your path variable.

jason perkins

I added mingw32/bin to my bin directories in compiler options, ran the Bat file again. Its doing the same old, runs for half a second and closes. I checked everywhere for the .o file and still don't have one :(. Thanks for the idea though. What does it mean for me to compiler the project as C, instead of c++ there's no option as far as I can tell to do that with Dev. Sigh setting stuff up sucks it took me about week to set up Opengl/allegro :(

Edgar Reynaldo

Go to the command line, and enter the line to alter your path that I showed you above, exchanging the directory I wrote there with whatever directory it really is.

Now navigate to the mappy directory with the buildalm.bat file and the source codes in it, and run buildalm.bat from the command line.

When it completes, right click on the command line window's title bar, and go to Edit->Select All, then right click again and go to Edit->Copy. Now paste the output of what you've just done above in a code window. I just did it myself, if you're using the Mappy Allegro playback library v11 (mapalr11.zip) like I did, you should get a whole bunch of deprecated function warnings, and some executables of the example programs.

jason perkins

Alright, and thanks for being thorough!

I've set my path, when I type path into command prompt I get

PATH = c:Dev-Cpp\mingw32\bin;c:

which seems about right. however when I run the .bat file BUILDALM.BAT
in command prompt I get this error:

C:\Users\Jperks>gcc pdemo1.c mappyal.o mapicon.o -mwindows -02
-Wall -o pdemo1.exe -lalleg

is not recognized as an internal or external command,
operable program or batch file

and repeats for several differant .c files

><

Edgar Reynaldo
Quote:

've set my path, when I type path into command prompt I get

PATH = c:Dev-Cpp\mingw32\bin;c:

which seems about right.

No, it's missing quite a few of the normal directories. Close the command console and open a new one. This will reset the environment variables such as the path variable.

When altering your path variable, you need to separate directories by a semi-colon, and make sure the old path stays in the string by using %PATH% as one of the directories.

So for you, it should suffice to use :

set PATH=c:\Dev-cpp\mingw32\bin;%PATH%

Then go back to the mappy allegro playback library directory using the cd command and try again.

jason perkins

its hopeless, the same thing happens.
line for line...

Microsoft Windows [Version 6.0.6001]
Copyright (c) 2006 Microsoft Corporation. All rights reserved.

C:\Users\Jperks>set PATH=c:\Dev-cpp\mingw32\bin;%PATH%

C:\Users\Jperks>path
PATH=c:\Dev-cpp\mingw32\bin;C:\Windows\system32;C:\Windows;C:\Windows\System32\W
bem;C:\hp\bin\Python

C:\Users\Jperks>cd C:\Users\Jperks\Desktop\mappy\mapalr11\mapalr11

C:\Users\Jperks\Desktop\mappy\mapalr11\mapalr11>BUILDALM.BAT

C:\Users\Jperks\Desktop\mappy\mapalr11\mapalr11>gcc mappyal.c -O2 -Wall -c -o ma
ppyal.o
'gcc' is not recognized as an internal or external command,
operable program or batch file.

C:\Users\Jperks\Desktop\mappy\mapalr11\mapalr11>windres mapicon.rc -o mapicon.o

'windres' is not recognized as an internal or external command,
operable program or batch file.

C:\Users\Jperks\Desktop\mappy\mapalr11\mapalr11>gcc pbdemo1.c mappyal.o mapicon.
o -mwindows -O2 -Wall -o pbdemo1.exe -lalleg
'gcc' is not recognized as an internal or external command,
operable program or batch file.

C:\Users\Jperks\Desktop\mappy\mapalr11\mapalr11>gcc pbdemo2.c mappyal.o mapicon.
o -mwindows -O2 -Wall -o pbdemo2.exe -lalleg
'gcc' is not recognized as an internal or external command,
operable program or batch file.

C:\Users\Jperks\Desktop\mappy\mapalr11\mapalr11>gcc pbdemo3.c mappyal.o mapicon.
o -mwindows -O2 -Wall -o pbdemo3.exe -lalleg
'gcc' is not recognized as an internal or external command,
operable program or batch file.

C:\Users\Jperks\Desktop\mappy\mapalr11\mapalr11>gcc mpgame.c mappyal.o mapicon.o
-mwindows -O2 -Wall -o mpgame.exe -lalleg
'gcc' is not recognized as an internal or external command,
operable program or batch file.

C:\Users\Jperks\Desktop\mappy\mapalr11\mapalr11>gcc mousecrd.c mappyal.o mapicon
.o -mwindows -O2 -Wall -o mousecrd.exe -lalleg
'gcc' is not recognized as an internal or external command,
operable program or batch file.

C:\Users\Jperks\Desktop\mappy\mapalr11\mapalr11>gcc proja.c mappyal.o mapicon.o
-mwindows -O2 -Wall -o proja.exe -lalleg
'gcc' is not recognized as an internal or external command,
operable program or batch file.

C:\Users\Jperks\Desktop\mappy\mapalr11\mapalr11>gcc isodemo.c mappyal.o mapicon.
o -mwindows -O2 -Wall -o isodemo.exe -lalleg
'gcc' is not recognized as an internal or external command,
operable program or batch file.

C:\Users\Jperks\Desktop\mappy\mapalr11\mapalr11>path
PATH=c:\Dev-cpp\mingw32\bin;C:\Windows\system32;C:\Windows;C:\Windows\System32\W
bem;C:\hp\bin\Python

C:\Users\Jperks\Desktop\mappy\mapalr11\mapalr11>Dossux

Edgar Reynaldo

Okay, it looks like you are setting the path correctly now. Some versions of MinGW may have renamed gcc and g++ to mingw32-gcc and mingw32-g++. You can create a copy of both mingw32-gcc and mingw32-g++ and rename the copies to gcc and g++.

Before you do that though, try typing this at the command line for me :

mingw32-gcc --version

and see if it works. If it doesn't work, then you haven't set the correct folder for the bin directory of your mingw installation, or your compiler's not installed correctly.

jason perkins

When i type that it gives me the schpeal about it not being an executable/command or Bat file. Did I fail :(

Edit, there's 2 directories that I have with stuff about mingw
This:
C:\Dev-Cpp\lib\gcc\mingw32\3.4.2\include
and
C:\Dev-Cpp\mingw32\bin
C:\Dev-Cpp\mingw32\lib

Edgar Reynaldo

Use explorer to look in the c:\dev-cpp\ folders for mingw32-gcc.exe and mingw32-g++.exe. If you find them, you can make a copy and rename them like I said before.

You can search for them from the command line with :

cd /d c:\dev-cpp
cls
dir /s *.exe

This will find all the executable files in your dev-cpp folder and all of it's subfolders. If mingw32-gcc.exe, mingw32-g++.exe, gcc.exe, or g++.exe aren't there anywhere, something's wrong.

As an aside, you can download the latest version of Code Blocks 8.02 and give it a try. It comes with MinGW as well, and is quite a nice editor if you ask me.

jason perkins

dude thanks for taking the time... I guess my compiler is set up a little differant than yours gcc was in dev-cpp\bin. But I wouldn't know where to begin without your help! At least I got the bat to work, and now its bedtime!

Neil Walker

My last allegro game (http://retrospec.sgn.net/game/tranzam) uses mappy. I think it's an excellent editor. There's also a little bit about mappy and other stuff at my little tutorial site (http://retrospec.sgn.net/users/nwalker/axl/tranzam.html) for the same game.

Edgar Reynaldo

So the compiler executables were in dev-cpp\bin? I'll try to remember that next time I help someone with Dev-C++. Glad it's working.

jason perkins

I'll definately check out that tutorial. And I like your game, but at this hour I'm just playing pin-ball with cactus' ^^

Thread #599125. Printed from Allegro.cc