spacer graphic
spacer graphic
Montage of games AGS Logo
spacer graphic

Welcome, Guest. Please login or register.
04 May 2011, 03:06

Home | Help | Search | Games | Wiki | Login | Register


AGS Forums  |  Using AGS  |  Technical Forum (Moderators: Iceboty V7000a, Scorpiorus, strazer)  |  Topic: Initial AGS Engine Source Code release « previous next »
Pages: [1] 2 3 Print
Author Topic: Initial AGS Engine Source Code release  (Read 4995 times)
Pumaman
Mittician
Administrator

Member


I sense danger.


« on: 27 Apr 2011, 01:55 »

Now that 3.2.1 has been released, AGS seems to be in a stable enough state to release the source code.

So, to that end I've added it to the SVN repository here:
https://svn.bigbluecup.com:7743/svn/ags/trunk
you will need the Common, NativeLibs and Engine folders within this.

I know there's been a lot of interest in this, so if you're a C++ programmer then the code is now available for your perusal. It's released under the Artistic License 2.0, as with the editor code.

You will need Visual C++ Express 2008 (this is a free download from MS). Do NOT use the 2010 version, this will probably not work and let's not complicate things at this stage by trying to use it.

In the VC++ Options, you'll need to add the /Common and /Common/libinclude folders to the VC++ Include Directories list.

You will also need to install the DirectX SDK from Microsoft if you don't already have it.

DO NOT use this source code as a learning resource or a guide on best practice.
The state of the source code is VERY BAD and should in fact be considered an example of BAD PRACTICE.
Unlike the AGS Editor code which is relatively modern and a generally good standard, the engine code dates back 12 years to 1999, and has a severe case of the another-bit-being-bolted-onto-the-side disease. It also retains compatibility with old versions which means that some of the old and particularly dire code paths cannot yet be removed.
So just to be clear, YES I KNOW that the code is in a bad state. You don't need to tell me that.
I also know that AGS is used by thousands of games with thousands of combinations of game settings and script functions, and that any attempt to refactor the code into a better state is likely to inadvertently break something in someone's game, which is why I haven't attempted to do it yet.

The first important question is, does it compile for you? I'm not 100% sure that I've uploaded everything it needs into SVN, so let me know.

If you're thinking about making a change to the engine, make sure you always consider:
* How does the change affect existing games? Will it break any backwards compatibility?
* Does the change work with all colour modes (8-bit, 16-bit, 32-bit)?
* Does it work with both "low-res" (320x200/320x240) and "hi-res" (640x400 upwards) co-ordinate systems?
* Does it work with both the DirectDraw and Direct3D graphics drivers?
* Is it cross-platform (ie. is there anything platform-specific that would break the Mac and Linux ports?)

If you're thinking about adding third-party libraries, remember that AGS must not use GPL libraries as the GPL license is too strict. Libraries licensed under the Lesser GPL (LGPL) are ok, however.
Always carefully read the license of any third-party libraries before proposing to use them in AGS.
« Last Edit: 28 Apr 2011, 15:07 by Pumaman » Logged
Kweepa
Member


Mutated Guano Deviser


« Reply #1 on: 27 Apr 2011, 03:08 »

It's asking for a username and password to access the subversion repositories.
But this is an awesome development! Larry Values!!11
Logged

Larry Values!!11 : You really should play it.
monkey_05_06
Member


With 90-somethin' percent accuracy!

AGS tutoring (no further info specified)Play-testing (no further info specified)Voice acting (no further info specified)Proof reading (no further info specified)Scripting (no further info specified)Story design (no further info specified)
Web design (no further info specified)

« Reply #2 on: 27 Apr 2011, 04:33 »

Unless he's changed it, you should gain access with username "guest" and no password.

Oh, also: Sweet! Time to hone up on my C++ skillz.
« Last Edit: 27 Apr 2011, 04:35 by monkey_05_06 » Logged

No I only use it for add extra fun to my and adding cloud strife to smash bros.

Nothing we can do will ever change the past; the only real power we hold is that of making a better future.
Calin Leafshade
Member


'bout time I got an avatar... I look like a girl.

Voice acting: I work well as quite strongly british characters. Especially posher, better spoken, james bond type charactersMusic: I compose music

« Reply #3 on: 27 Apr 2011, 07:04 »

Would someone mind zipping it up and posting it somewhere for me?

My proxy server at work is mangling the svn http requests in transit.

Thanks gorgeouses.
Logged


Leon: You need the sword first before you can get the monkey.
Sephiroth
Member


Lotus

Play-testing: Gamer/Scripter constructive point of view.Scripting: PM me if you need some help :)

« Reply #4 on: 27 Apr 2011, 08:45 »

Just awesome! Thank you very much for sharing  Shocked

A quick link for Calin if you still need it.

LINK
Logged
abstauber
Member


Braiins


« Reply #5 on: 27 Apr 2011, 09:01 »

just amazing... who would have imagined that back in 99 Cheesy

Too bad I won't be able to contribute to the code, but I'll do my best to work on a modern hi-res template.
Logged

Sslaxx
Member



« Reply #6 on: 27 Apr 2011, 10:14 »

Thanks for this, Chris!

Very initial thought: the headers on some of the files need to be altered to reflect the change of licensing.
« Last Edit: 27 Apr 2011, 10:20 by Sslaxx » Logged

Stuart "Sslaxx" Moore.
subspark
Member


I have the wisdom of a much younger man.

Play-testing: This reflects my experience as a professional. Need a hand? Sure!Voice acting: This reflects my experience as a professional. Need a hand? Sure!Music: This reflects my experience as a professional. Need a hand? Sure!Backgrounds: This reflects my experience as a professional. Need a hand? Sure!Character art: This reflects my experience as a professional. Need a hand? Sure!Animation: This reflects my experience as a professional. Need a hand? Sure!
Proof reading: This reflects my experience as a professional. Need a hand? Sure!Story design: This reflects my experience as a professional. Need a hand? Sure!Translating: This reflects my experience as a professional. Need a hand? Sure!

« Reply #7 on: 27 Apr 2011, 11:24 »

Hey great work, Chris! A million thanks for doing this.  Kiss
Well this should be an interesting decade! Larry Values!!11

Cheers!
Logged

     
Adlanto - A bold step into a valley of forgotten worlds - Coming Soon to Steam in August 2015!       Indiana Jones and the Fountain of Youth - Indy is back!
Wyz
Member


anno 1986

Voice acting: English, DutchMusic: also midi, various stylesScripting (no further info specified)Story design: just give me a few pointersWeb design: css, html and phpTranslating: english <-> dutch

« Reply #8 on: 27 Apr 2011, 15:51 »

The state of the code doesn't look that bad to me, I've seen worse. Smiley
I'm an experienced C/C++ programmer and as soon have time on my hand I'll dive right in. First stop: finding out how portable it is, I first might try to compile it with other compilers and see how much breaks. I know the plug-ins will break, but that will be the first step toward cross-platform compatibility.
Thanks for releasing it, and thanks for creating it in the first place. Much appreciated!
Logged

Life is like an adventure without the pixel hunts.
Pumaman
Mittician
Administrator

Member


I sense danger.


« Reply #9 on: 27 Apr 2011, 16:01 »

Very initial thought: the headers on some of the files need to be altered to reflect the change of licensing.

Good point, I need to update those.

Quote
First stop: finding out how portable it is, I first might try to compile it with other compilers and see how much breaks. I know the plug-ins will break, but that will be the first step toward cross-platform compatibility.

The codebase includes all the changes that were made to get the Mac and Linux ports working, so getting these to build should not be a big task.

The platform-specific code is in the ACPLXXX.CPP files, where ACPLWIN is the Windows port, ACPLLNX is the linux one and ACPLMAC is the mac port. However these may no longer build correctly with the latest 3.2.1 code, so may need some fixing up.
Logged
Matti
Member



« Reply #10 on: 27 Apr 2011, 16:09 »

This is great news! I can't contribute anything but I'm totally looking forward to all the cool changes that will be made!

Well this should be an interesting decade! Larry Values!!11

Indeed!
Logged

Calin Leafshade
Member


'bout time I got an avatar... I look like a girl.

Voice acting: I work well as quite strongly british characters. Especially posher, better spoken, james bond type charactersMusic: I compose music

« Reply #11 on: 27 Apr 2011, 16:15 »

Is the compiler included in this release?

I assume thats included in the ags.native assembly but i dont see the code for it.
Logged


Leon: You need the sword first before you can get the monkey.
tzachs
Member


Fire! Fire!

AGS tutoring (no further info specified)Play-testing (no further info specified)Music (no further info specified)Scripting (no further info specified)Story design (no further info specified)Translating: If anyone wants hebrew translation, that is...

« Reply #12 on: 27 Apr 2011, 20:59 »

This is super cool!
I'm not gonna touch the engine myself since I'm a spoiled c-sharper, so I'm gonna stick with the editor, but really excited to see what will people come up with.
Logged

Greg Squire
Member


« Reply #13 on: 28 Apr 2011, 01:30 »

This is very awesome!  Thanks for opening this up Chris!  Looking forward to seeing what you all do to make AGS even more awesome.
Logged
kingstone
Member
Posts: 5



« Reply #14 on: 28 Apr 2011, 02:53 »

Wonderful news! Cheesy Now let's get this ball rolling!

I'm having some problems compiling the engine in VC++ 2008. First off there is a reference to dinput.h which is not included. This can be fixed by installing the Direct X SDK and adding the SDK's /include/ folder to the VC++ include directories (just like /Common/ and /Common/libinclude/).

Then in almp3.c there are hard coded #include paths to mpg123.h and mpglib.h.
I tried changing these to just "mpg123.h" and "mpglib.h" so that they include files from the libinclude folder. This doesn't seem to be the right files though, because it generates a bunch of compile time errors:

Code:
------ Build started: Project: acwin, Configuration: DebugWorking Win32 ------
Compiling...
almp3.c
Y:\Dev\AGS\Common\libinclude\mpglib.h(22) : error C2079: 'fr' uses undefined struct 'frame'
Y:\Dev\AGS\Common\libinclude\mpglib.h(23) : error C2065: 'MAXFRAMESIZE' : undeclared identifier
Y:\Dev\AGS\Common\libinclude\mpglib.h(23) : error C2057: expected constant expression
Y:\Dev\AGS\Common\libinclude\mpglib.h(23) : error C2087: 'bsspace' : missing subscript
Y:\Dev\AGS\Common\libinclude\mpglib.h(24) : error C2061: syntax error : identifier 'real'
Y:\Dev\AGS\Common\libinclude\mpglib.h(28) : error C2061: syntax error : identifier 'synth_buffs'
Y:\Dev\AGS\Common\libinclude\mpglib.h(28) : error C2059: syntax error : ';'
Y:\Dev\AGS\Common\libinclude\mpglib.h(28) : error C3409: empty attribute block is not allowed
Y:\Dev\AGS\Common\libinclude\mpglib.h(28) : error C2143: syntax error : missing ']' before 'constant'
Y:\Dev\AGS\Common\libinclude\mpglib.h(30) : error C2059: syntax error : '}'
[and more]

The hard coded paths reference a folder named /almp3_205/decode/ but I have been unable to google anything like that. How can I find the correct files to include?

Thanks a lot for releasing the source code CJ, I believe this will open up for lots of collaborative improvements ahead! Smiley
Logged

Sephiroth
Member


Lotus

Play-testing: Gamer/Scripter constructive point of view.Scripting: PM me if you need some help :)

« Reply #15 on: 28 Apr 2011, 14:10 »

You'll most probably need to install allegro to VC 2008, I'll update the post to let you know if I can compile.
Logged
Pumaman
Mittician
Administrator

Member


I sense danger.


« Reply #16 on: 28 Apr 2011, 14:43 »

Is the compiler included in this release?

I assume thats included in the ags.native assembly but i dont see the code for it.

No, the editor's Native assembly is not yet released. That will follow, but has further complications and it also cannot be compiled by the free Express versions of Visual Studio, which makes a source code release less useful.
Obviously though, to make any changes that need the game compiler to produce a different output, this will need to be modified so I will be providing the source in due course.

Quote
I'm having some problems compiling the engine in VC++ 2008. First off there is a reference to dinput.h which is not included. This can be fixed by installing the Direct X SDK and adding the SDK's /include/ folder to the VC++ include directories (just like /Common/ and /Common/libinclude/).

Ah thanks, I should have mentioned this. First post updated.

Quote
Then in almp3.c there are hard coded #include paths to mpg123.h and mpglib.h.
I tried changing these to just "mpg123.h" and "mpglib.h" so that they include files from the libinclude folder. This doesn't seem to be the right files though, because it generates a bunch of compile time errors:

Well spotted, I've checked in a fix for this so please try again with the latest version.

Basically the complication here is that AGS uses both ALMP3 (for MP3 playing) and APEG (for Theora video), but ALMP3 and APEG each use different versions of another library called MPGLIB. So AGS ends up having to include two different MPGLIBs, and has to manually direct ALMP3 to one of them and APEG to the other.
« Last Edit: 28 Apr 2011, 14:46 by Pumaman » Logged
dbuske
Member

Play-testing (no further info specified)

« Reply #17 on: 28 Apr 2011, 15:36 »

I suggest that the code just be updated with c++ first, so there is a solid windows base.
Then when that is done then work on other ports.
Logged
Electroshokker
Member



« Reply #18 on: 28 Apr 2011, 16:28 »

Sweet. I'll see if I can make a linux build of 3.2.1 soon.

Chris, are any parts of the source still closed?

I could release my linux Code::Blocks projects (with instructions) with your permission. (Can I release older versions of the engine or only the latest?)
I'm sure some of the more enthousiastic folks out there would love to start from a proper IDE setup, rather than starting with raw code.

Also, SVN will help a ton in re-integrating all the changes I made into AGS.

Anyways, great to see the engine going open source. That'll speed things up a notch or two. (I'd love to debate my usage of the Allegro 4.4 branch in Linux and the OpenGL integration, the last of which I haven't had any time for so far.)

EDIT:

Oh, and for your question: * Is it cross-platform (ie. is there anything platform-specific that would break the Mac and Linux ports?)

Hell yeah a bunch of stuff breaks for Linux... but I can help with that. I'd be happy to help any linux enthousiast to get it up and running.
« Last Edit: 28 Apr 2011, 16:34 by Electroshokker » Logged
ProgZmax
Member


I looooove you!

Music: Ya.Character art: RightAnimation: I say, good show.Proof reading: Quite.Scripting: Indeed.Story design: Yes.

« Reply #19 on: 28 Apr 2011, 17:39 »

Very very nice, CJ.  I know how much you love AGS and want to protect it so people should consider this to be an exceptional olive leaf on your part and hopefully no one will make you regret it.
Logged

Pages: [1] 2 3 Print 
AGS Forums  |  Using AGS  |  Technical Forum (Moderators: Iceboty V7000a, Scorpiorus, strazer)  |  Topic: Initial AGS Engine Source Code release « previous next »
Jump to:  


Login with username, password and session length

Powered by SMF 1.1.13 | SMF © 2006-2009, Simple Machines LLC
Page created in 0.166 seconds with 16 queries.