Allegro.cc - Online Community

Allegro.cc Forums » The Depot » Alien 8 - Source code released

This thread is locked; no one can reply to it. rss feed Print
Alien 8 - Source code released
Ignacio
Member #1,703
December 2001
avatar

Hi all!
Just as promised, I've just made public the source code of my Allegro remake of Alien 8.
Go to http://retrospec.sgn.net/game/alien8 to get it if you are interested :)

SiegeLord
Member #7,827
October 2006
avatar

Thanks for releasing the source! :D

I had to change the code in a few places to make it compile, but otherwise it worked flawlessly under Linux.

EDIT: Here are the two changes (well there was the third one, but that is to define the platform, so that was normal).

I had to expand these conditionals, because the left side could not be resolved by gcc.

On line 2785 in juego.c

(dato==D_X?movs[f].m0:movs[f].m1)=(dif<0?-1:1);

I changed it to:

if(dato==D_X)
   movs[f].m0 = (dif<0?-1:1);
else
   movs[f].m1 = (dif<0?-1:1);

and on line 2812 in juego.c

(dato==D_X?movs[f].m0:movs[f].m1)=dif;

changed to

if(dato==D_X)
   movs[f].m0 = dif;
else
   movs[f].m1;

"For in much wisdom is much grief: and he that increases knowledge increases sorrow."-Ecclesiastes 1:18
[SiegeLord's Abode][Codes]:[DAllegro5]:[RustAllegro]

Peter Hull
Member #1,136
March 2001

I've built a Mac version too - it was one of the easier 'conversions' It works OK but I need to modify it slightly to avoid writing its config files into the executable bundle.
{"name":"595405","src":"\/\/djungxnpq2nug.cloudfront.net\/image\/cache\/8\/c\/8c0eec007aadc4a7286cf4de93c1f45e.png","w":663,"h":525,"tn":"\/\/djungxnpq2nug.cloudfront.net\/image\/cache\/8\/c\/8c0eec007aadc4a7286cf4de93c1f45e"}595405
Looks lovely but it's a lot quicker than I remember it - too quick for my old reflexes....

Pete

Neil Walker
Member #210
April 2000
avatar

I don't know why linux didn't work as he's using mingw, which should be the same. Just remember though (unless he's forgotten!) that the encryption code for generating high-score entries is deleted from the source code.

Unfortunately it will always be that case for source code releases/conversions supplying source code as we don't want our algorithm know.

Neil.
MAME Cabinet Blog / AXL LIBRARY (a games framework) / AXL Documentation and Tutorial

wii:0356-1384-6687-2022, kart:3308-4806-6002. XBOX:chucklepie

Peter Hull
Member #1,136
March 2001

AFAIK, (a?b:c) isn't an lvalue in standard C but it is in C++. However in GCC it is even in C. I don't know why SiegLord's didn't work - maybe he has a different version of gcc.

Pete

SiegeLord
Member #7,827
October 2006
avatar

My gcc version is 4.2.3, if that helps. I did compile the thing in Code::Blocks, but even doing something like 'gcc test.c' with test.c being:

int main()
{
    int a,b;
    (1 ? a : b) = 1;
    return 0;
}

still throws the error, so it isn't anything special that C::B does.

"For in much wisdom is much grief: and he that increases knowledge increases sorrow."-Ecclesiastes 1:18
[SiegeLord's Abode][Codes]:[DAllegro5]:[RustAllegro]

James Stanley
Member #7,275
May 2006
avatar

Quote:

Unfortunately it will always be that case for source code releases/conversions supplying source code as we don't want our algorithm know.

Security by obscurity ain't security.
Unless it's just the key being obscured, but you make it sound like the algorithm is the secret part.
If the algorithm hasn't been reviewed by most of the cryptographic community, it can't be considered secure.
Granted, in this case, nobody is going to go to the trouble of breaking it.

EDIT:
Also, can I ask what license it's released under...?

OICW
Member #4,069
November 2003
avatar

AFAIK ternary operator can be used for assining value or comparing. So determining which value should be assigned through ternary operator is quite weird and I wonder why it worked.

Quote:

AFAIK, (a?b:c) isn't an lvalue in standard C but it is in C++. However in GCC it is even in C. I don't know why SiegLord's didn't work - maybe he has a different version of gcc.

That depends on C standard, there's difference between ANSI C and C99. I can't recall which one is it, but one allows C++ like constructs, for example

for (int i = 0; i < 10; i++)
  printf("i = %d", i);

while the other isn't. I think that the benevolent one is ANSI C but I'm not sure about that.

[My website][CppReference][Pixelate][Allegators worldwide][Who's online]
"Final Fantasy XIV, I feel that anything I could say will be repeating myself, so I'm just gonna express my feelings with a strangled noise from the back of my throat. Graaarghhhh..." - Yahtzee
"Uhm... this is a.cc. Did you honestly think this thread WOULDN'T be derailed and ruined?" - BAF
"You can discuss it, you can dislike it, you can disagree with it, but that's all what you can do with it"

Vanneto
Member #8,643
May 2007

The C99 standard supports initializing variables in for() loops AFAIK.

In capitalist America bank robs you.

OICW
Member #4,069
November 2003
avatar

Vanneto: nope, this is what compiler threw at me when I compiled the code above (for cycle):
error: ‘for’ loop initial declaration used outside C99 mode

[My website][CppReference][Pixelate][Allegators worldwide][Who's online]
"Final Fantasy XIV, I feel that anything I could say will be repeating myself, so I'm just gonna express my feelings with a strangled noise from the back of my throat. Graaarghhhh..." - Yahtzee
"Uhm... this is a.cc. Did you honestly think this thread WOULDN'T be derailed and ruined?" - BAF
"You can discuss it, you can dislike it, you can disagree with it, but that's all what you can do with it"

Matthew Leverton
Supreme Loser
January 1999
avatar

The error message implies you aren't using C99.

OICW
Member #4,069
November 2003
avatar

Oh well, then it's the ANSI C that forbids it.

[My website][CppReference][Pixelate][Allegators worldwide][Who's online]
"Final Fantasy XIV, I feel that anything I could say will be repeating myself, so I'm just gonna express my feelings with a strangled noise from the back of my throat. Graaarghhhh..." - Yahtzee
"Uhm... this is a.cc. Did you honestly think this thread WOULDN'T be derailed and ruined?" - BAF
"You can discuss it, you can dislike it, you can disagree with it, but that's all what you can do with it"

Neil Walker
Member #210
April 2000
avatar

Quote:

Security by obscurity ain't security. Unless it's just the key being obscured, but you make it sound like the algorithm is the secret part. If the algorithm hasn't been reviewed by most of the cryptographic community, it can't be considered secure.
Granted, in this case, nobody is going to go to the trouble of breaking it.

I never said it was secure. Giving somebody the key to your cake cupboard makes them more like to eat them then not. It's simply to stop most people who play our games from generating their own codes and spoiling the highscore tables. The codes generated are both lightly encrypted and contain key data that makes it obvious when they've cheated by using memory trainers (for the games that don't have anti-trainer code in), so cracking it might not necessarily give you a good code ;) but feel free to try and crack it, I'll give you a free copy of the next game from our site if you do.

Neil.
MAME Cabinet Blog / AXL LIBRARY (a games framework) / AXL Documentation and Tutorial

wii:0356-1384-6687-2022, kart:3308-4806-6002. XBOX:chucklepie

Ignacio
Member #1,703
December 2001
avatar

Hi there, about the lvalue stuff, I thought it was standard C. If it's not, of it it depends on the version, I'll just try to avoid that on my future games :)
And about the license, I never bothered much with those things. I just made the code public just in case someone is courious enough and wants to take a look. Everything else, I just don't care :)

Go to: