Skip to main content
GameDev.net gamedev.net
🔒 Locked

exploring golgotha source code

Started by Drone Aug 23, 2000 at 12:59 AM 12 replies 1.6k views
Original Post
Drone
Drone
The source code to a game called golgotha was released to the public domain a while back. I thought it might be interesting to try to work with it a bit and report what I find. The first thing is to download the source. Links can be found on the following web page: http://www.crack.com/golgotha/browse.html Its big (30MB) so forget it if you don''t have access to a high speed line. The code looks well organized but it uses a different style of C++ file extensions that I''m not used to and VC doesn''t seem to understand so I wrote some java programs to convert. The java source is here: http://home.earthlink.net/~uubp/golgutil.zip Run Rename first to change the files from .hh to .h and .cc to .cpp. Run Replace to change all #include "*.hh" to #include "*.cc" to #include ".cpp". In my next report I will talk about the project.i4 files and how they describe how to build the executable. If you don''t see this report in the next 5 days, you are welcome to remind me at uubp@earthlink.net - Brad Pickering http://home.earthlink.net/~uubp/ Home for organically grown games
Brad Pickeringhttp://home.earthlink.net/~uubp/Home for organically grown games
Wavinator
Wavinator
What a cool thing to do. I''ve got to go check these guys out. Golgotha looks like it had so much promise, as did Crack.dot.com.

Wish more companies would release code they can''t use rather than let it rot in some storage box somewhere...

--------------------
Just waiting for the mothership...
--------------------Just waiting for the mothership...
Martee
Martee
.cc is just another way of distinguishing c++ source files from c source files. Same with .hh, it just tells you it''s a c++ header.

Martee
Magnum Games
ReactOS - an Open-source operating system compatible with Windows NT apps and drivers
xeos
xeos
I''ve toyed a bit with Golgotha, but I couldn''t get it to build (I was using Borland C++ Builder 2 at the time, and I had to rename all the files, plus change all the #includes manually!!)

I found that the code is really messy... all that Cross-Platform junk drove me mad!

Golgotha is a BIG system, and it''s not the easiest to follow. i4 alone (the underlying system stuff) is a complex beast, and, just like crack.com, golgotha got to me too before I could get to it!

Best of luck,
Simon Wilson
XEOS Digital Development
XEOS Digital Development - Supporting the independant and OpenSource game developers!
Eck
Eck
I look forward to your findings. I hope you do not mind all us lazy bastards make you do all the grunt work.

Later,
Eck
Drone
Drone
I''ve worked on big projects and cross platform projects before so I don''t think golgotha will get me down.

I don''t mind doing the grunt work because I''m guessing it will be contagious and I''ll get people interested later. And I''ll try to turn the grunt work in to interesting projects. For instance I could have renamed all the files manually but I decided to write a program to do the change. I could build the VC project files by hand (and I''ve actually done it) but I think it will be more interesting to write a program to convert the .i4 files to Visual C projects.

Hopefully my next report will have this program done.




- Brad Pickering
http://home.earthlink.net/~uubp/
Home for organically grown games
Brad Pickeringhttp://home.earthlink.net/~uubp/Home for organically grown games
Drone
Drone
I''ve updated golgutil.zip to include my VC++ 6.0 project files. These were hand built, very tedious, but they might get you going until I''ve got the Java program that converts .i4 files into VC project files. The link is
http://home.earthlink.net/~uubp/golgutil.zip.


- Brad Pickering
http://home.earthlink.net/~uubp/
Home for organically grown games
Brad Pickeringhttp://home.earthlink.net/~uubp/Home for organically grown games
Drone
Drone
http://home.earthlink.net/~uubp/golgutil.zip now contains a java program called Build.java which does most of the work in translating the golgotha .i4 files into VC project files. I''ve tested the process out on spin_cube and included my build notes in a file called java.txt.

Here is some info on the .i4 files. This file serves the same purpose as makefile but was probably easier to work with in a multiplatform development. These files are composed of sections of related code. The top section is an ''executable'' section. Dependencies are indicated with a ''use'' line which can refer to another section in the current file or another .i4 file. ''add_include_directory'' adds a directory to the list of places to look for header files. ''add_to_executable'' indicates that a source file needs to be in the executable rather than a library, usually because the file contains a staticly allocated instance of a class that might get left out by the linker if it is only in a library. ''ram_file'' indicates a resource file that needs to be converted into source code to get hardwired into the executable. Other keywords include ''win32'' and ''linux'' to indicate that a particular file is used on one platform but not the other.

If you have any questions on building the spin_cube test application or have questions on the .i4 files let me know.

- Brad
Brad Pickeringhttp://home.earthlink.net/~uubp/Home for organically grown games
Drone
Drone
I made a zip of the golgotha source with only the test programs and the ''i4'' library. Its less than 3MB so if you want to look at the code without downloading a huge file, this might be of use. If you want to write a game but dont want to write all the core code, golgotha will give you a good start.

http://home.earthlink.net/~uubp/i4src.zip


- Brad Pickering
http://home.earthlink.net/~uubp/
Home for organically grown games
Brad Pickeringhttp://home.earthlink.net/~uubp/Home for organically grown games
wrenhal
wrenhal
quote:
Original post by Hootie

BTW, the above was me. I''ve had that site for over a year. Anyway lotsa luck with the Golgotha source. It''s a major mess.


He could''ve just done it for the ''fun'' of it. ha ha.
Or maybe he just wanted to learn stuff. Learning by doing is always the best way.


By the way. Anybody know if someone has tried to translate the source to VB?

Also, Would any of this source work on BeOS????

BeS
It's Da BOMB Baby!!!
Drone
Drone
The first class to get to know is the application class
''i4_application_class''. This class takes care of initilization
and cleanup of the major subsystems and provides methods for
getting input, updating, and displaying. This is the typical
MVC (model, veiw, controller) division of labor. The methods
are called ''get_input'', ''calc_model'', and ''refresh'' and should
be overriden in your derived app class to do whats right for
your application.

Below is a simple example program that loads a file and quits
on the first loop. The ''init'' method is overriden but in this
case its not needed because the only call I make is to the
base class ''init'' method. The ''calc_model'' function calls
''LoadFile'' and then ''quit''. Calling quit causes a break out
of the main loop after the function returns. The LoadFile
function is an example of how to read a file. I wont explain
that class right now but its pretty similar to other file
classes I''ve seen.

This description is probably not very good so if you have any
questions let me know.

- Brad

#include "app/app.h"
#include "file/file.h"
#include "string/string.h"

static void LoadFile(void)
{
i4_const_str fileName("project.i4");
i4_file_class *fp = i4_open(fileName, I4_READ);
if (fp != NULL)
{
char buffer[128];
fp->read(buffer, sizeof(buffer));
delete fp;
}
}

class test_app : public i4_application_class {
public:
void init()
{
i4_application_class::init();
}

void calc_model()
{
LoadFile();
quit();
}

char *name()
{
return "test_app";
}
};

void i4_main(w32 argc, i4_const_str *argv)
{
test_app test;
test.run();
}

---------------------------------------
Here is the project file in i4_make format

[executable gamedev]
use file=../../i4/project.i4 app
use file=../../i4/project.i4 X11_display
use file=../../i4/project.i4 dx5_display
use file=../../i4/project.i4 math
use file=../../i4/project.i4 lisp
use file=../../render/project.i4 render

gamedev.cc

It can be converted to a VC++ project as described earlier.
Brad Pickeringhttp://home.earthlink.net/~uubp/Home for organically grown games
Drone
Drone
Below is an example of how to read and get values from golgotha config files. These files are usually stored in .res files. here is an example:

------------- test.res -----------
a = 5
b = 6
op = "add"
------------- end ----------------

// this function demonstrates loading a string resource
// file and getting some values
static void GetStringResources(void)
{
// load a string resource file
i4_string_man.load("test.res");

// get some integer values
int a = i4getn("a");
int b = i4getn("b");

// get a string value
const i4_const_str &op = i4gets("op");

// do something
int r;
if (i4_const_str("add") == op)
r = a + b;
else if (i4_const_str("sub") == op)
r = a - b;

// set a string resource from memory
char buffer[512];
sprintf(buffer, "result = %d\n", r);
i4_string_man.load_buffer(buffer, "buffer");
}



- Brad Pickering
http://home.earthlink.net/~uubp/
Home for organically grown games
Brad Pickeringhttp://home.earthlink.net/~uubp/Home for organically grown games

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.