Allegro.cc - Online Community

Allegro.cc Forums » The Depot » [Community Project] AMGC2

This thread is locked; no one can reply to it. rss feed Print
[Community Project] AMGC2
juvinious
Member #5,145
October 2004
avatar

He said "community" in the title, not everyone in the community uses windows. :P
It would be nice to see this work cross platform anyhow. :)
[edit]
NM my post-fu is teh slow....
Downloading now.

__________________________________________
Paintown

miran
Member #2,407
June 2002

Quote:

It would be nice to see this work cross platform anyhow. :)

Haha, too late! I already made it compile on Linux!

No, wait just a second, I might need to update the MASkinG release or at least the CVS. I had to make some changes to make it compile on 64 bit Linux...

--
sig used to be here

juvinious
Member #5,145
October 2004
avatar

Quote:

No, wait just a second, I might need to update the MASkinG release or at least the CVS. I had to make some changes to make it compile on 64 bit Linux...

I just checked MASkinG out from CVS a few mins ago... It compiled fine for me.

__________________________________________
Paintown

miran
Member #2,407
June 2002

Yeah, I did a comit of my last changes a half hour ago. The last release (v0.79) didn't compile on 64 bit platforms because of a stupid little mistake. On 32 bit platforms there never was a problem of course...

--
sig used to be here

juvinious
Member #5,145
October 2004
avatar

Ok just finished compiling amgc2 for linux. The interface works perfectly fine and the first 2 games kickups and quad are fine too. Tetris however, dies a horrible death. And your makefile for the games has a darts game listed but there is no files for it.....
Another thing the binary it spits out is AMGC2.exe. It would probably look better as amgc2. ;)

I'll play around with it a bit more tomorrow and see if I can create something to share with the rest of the community.

Oh yeah btw here's what i got from tetris in gdb:

(gdb) run
Starting program: ~/allegro-related/amgc2/amgc2
(no debugging symbols found)
(no debugging symbols found)
(no debugging symbols found)
[Thread debugging using libthread_db enabled]
[New Thread 16384 (LWP 29997)]
[New Thread 32769 (LWP 30058)]
[New Thread 16386 (LWP 30059)]
[New Thread 32771 (LWP 30071)]
Program received signal SIGSEGV, Segmentation fault.
[Switching to Thread 16384 (LWP 29997)]
0x080710cb in destroy_screenshot ()

__________________________________________
Paintown

Trezker
Member #1,739
December 2001
avatar

Feature request, configurable keys.

I don't want to use the arrow keys in my game, at least when I play it I want to use WASD instead.

I'm not gonna give any info about my game except that an inspiration particle hit me spot on. I haven't put in the gameplay yet, but it's already a lot of fun. :)
I've been working on it for 4 hours now. ;D

EDIT!
You guys aren't posting fast enough.
I've sort of finished the game. A couple of things should be fixed, but they're not fit to solve when I'm this tired.
Hmm, one game, 5 and a half hour...

Plugin zipped and attached.

Billybob
Member #3,136
January 2003

Bad news, good news, make up your mind miran!
Well I'm glad it's working! Hope we get 10 games by the end of the week.

miran
Member #2,407
June 2002

Quote:

Ok just finished compiling amgc2 for linux. The interface works perfectly fine and the first 2 games kickups and quad are fine too.

Excellent!

Quote:

Tetris however, dies a horrible death.

Not good :( Does it happen every time, or just every now and then? Or maybe only after you've played another game? I don't see why it would crash when the others work, I mean it doesn't do anything special. Well, actually it does install its own timer but I don't think that should be a problem. Or maybe there's just a simple little error hidden somehere in that enormous pile of code junk that doesn't surface on my computer...

Quote:

And your makefile for the games has a darts game listed but there is no files for it.....

Ooops, I made a darts game but didn't include it because there's around 500k worth of data that comes with it and I forgot to remove the entry from the makefile. I'll attach the game here if it doesn't exceed the 500k limit...

Quote:

Another thing the binary it spits out is AMGC2.exe. It would probably look better as amgc2. ;)

Yeah, you're right, it's just that I'm so used to Windows... :P I'll change it to "amgc2". :)

Quote:

I'll play around with it a bit more tomorrow and see if I can create something to share with the rest of the community.

Already looking forward to it! :)

Quote:

Feature request, configurable keys.

That's been on my todo list since the beginning, but I was too lazy to implement it. There's just one thing. I was thinking of making this configurable on a global level, for all games, but now that I think about it, per-game settings would be more appropriate. Or maybe I'll do both, global settings and per-game overrides. I was also thinking of doing general per-game settings. Like every game would say what can be configured and how and the host program would provide a GUI to modify the settings. But then that would complicate the API quite a bit, I think... :-/

Quote:

You guys aren't posting fast enough.
I've sort of finished the game. A couple of things should be fixed, but they're not fit to solve when I'm this tired.

Hmm, one game, 5 and a half hour...

Plugin zipped and attached.

Teh awesome! ;D Great game to play for a few minutes, exactly what I had in mind. Yeah, WSAD keys would definitely work a lot better for this game. To use the arrows you kind of have break your hand :P A couple of things it could use would be a health bar and points. Like every hit gives you some points and every kill gives you double points, or something. Also that "click to play again" doesn't really work that well. I mean when you're clicking furiously, you don't see the message for more than a split second when you die, you immediately start a new game. I think it'd be better for the Logic function to just return 1 at that point and let the host program handle the "game over" situation... :)

Quote:

Well I'm glad it's working! Hope we get 10 games by the end of the week.

Me too... :D

--
sig used to be here

Trezker
Member #1,739
December 2001
avatar

You don't need a health bar, you can see your circles radius.

The click for new game was done after I enabled holding the mouse button continously so I forgot to try it while clicking all the time.
But I didn't know which keys where A-D.

I was also thinking of adding some more powerful weapon for right mouse button that you gain access to if you pick up greens when your radius is full. Or maybe you could sacrifice a radius to use it... Don't know how such a weapon should act though, a storm of blacks in all directions perhaps...

Then there's the collision response. Now they just get a new direction dictated by the angle of the collision. I'd like to make that reflective instead. sigh more math...

Heh, just figured out how to keep score. :)

miran
Member #2,407
June 2002

Quote:

You don't need a health bar, you can see your circles radius.

Yeah, I realized that the minute I posted... :)

Quote:

The click for new game was done after I enabled holding the mouse button continously so I forgot to try it while clicking all the time.

Ooh, I didn't realize you can hold down the mouse button :o

Quote:

But I didn't know which keys where A-D.

That's so stupid of me. As I said I was planning to make the keys configurable so I just wrote A,B,C,D in the comments but when I didn't manage to actually implement key overrides I forgot to update the documentation. The action keys are hardcoded to be Ctrl, Space, Alt and Shift. I think in that order...

Quote:

I was also thinking of adding some more powerful weapon for right mouse button that you gain access to if you pick up greens when your radius is full. Or maybe you could sacrifice a radius to use it... Don't know how such a weapon should act though, a storm of blacks in all directions perhaps...

Then there's the collision response. Now they just get a new direction dictated by the angle of the collision. I'd like to make that reflective instead. sigh more math...

Math is fun :):P;)

--
sig used to be here

juvinious
Member #5,145
October 2004
avatar

Quote:

Not good :( Does it happen every time, or just every now and then? Or maybe only after you've played another game?

Yeah not good at all, it does it all the time. As soon as I start it crashes the whole app. I can't figure out what's going wrong I just get a seg fault.

And I was wondering, as I was trying out Trezkers SOD, do you have to use:

extern "C" __declspec(dllexport) IGame* GetPlugin() 
{ 
  return new Game; 
}

for windows and:

extern "C" DLLEXPORT IGame* GetPlugin() { 
  return new Game; 
}

for others?
Is it not possible to just use DLLEXPORT for all?
Having to check for platform is extra work. :P

__________________________________________
Paintown

Trezker
Member #1,739
December 2001
avatar

http://trezker.bafserv.net/files/amgc2/sod.zip

New version.
Implemented all mentioned stuff except the bounce improvement.

miran
Member #2,407
June 2002

Quote:

And I was wondering, as I was trying out Trezkers SOD, do you have to use:
--snip--

DLLEXPORT should be used. On Widnows it is defined as __declspec(dllexport) and on other platforms as nothing. Trezker is obviously using the old template.cpp from v2.00. The one in 2.01 has DLLEXPORT instead of __declspec(dllexport).

@Trezker: You should replace __declspec(dllexport) with DLLEXPORT in your game and make sure you include the new 2.01 IGame.h header :)

EDIT: Also your new link doesn't seem to work. It throws me directly to www.allegro.cc

EDIT2: It works if you copy&paste the URL...

--
sig used to be here

Trezker
Member #1,739
December 2001
avatar

Fixed link.
Before I release next version I'd like some help with the bounce code.

Angle is the angle towards the other circle.
dy, dx is the speeds.
It's fine at some angles but sometimes it craps up.

1angle+=M_PI;
2if(angle>=M_PI*2)
3 angle-=M_PI*2;
4float a=atan2(dy, dx)+M_PI;
5if(a>=M_PI*2)
6 a-=M_PI*2;
7float s=sqrt(dx*dx+dy*dy);
8float d1 = ((a - angle) + M_PI*4);
9while(d1>=M_PI*2)
10 d1-=M_PI*2;
11d1-=M_PI;
12angle+=2*-d1;
13dx=cos(angle)*s;
14dy=sin(angle)*s;
15x+=dx;
16y+=dy;

miran
Member #2,407
June 2002

Hmm, I don't really understand what that code is doing. But shouldn't the bouncing be done like this:

1. Find the point where the circles collide (depends on the positions of the circles and their size).
2. Calculate the tangents and normals at that point for both circles.
3. Bounce ball #1 as if it hit a straight wall represented by the tangent of ball #2 + the angle at which ball #2 is travelling. The out angle should be the same as the in angle except it should be mirrored around the normal. Do the same with ball #2.

?

--
sig used to be here

umperio
Member #3,474
April 2003
avatar

Ok this is an idiot game, but I was really curious how this thing worked so I tryed, if there's interest in it I could work on it a bit more (well actually I'm going to improve it anyway). This is just a "test if it works for you" more than a release.

Suggestions, comments, critics are welcome but keep in mind it's not meant to be complete so please be kind :P

Everything attached

Trezker
Member #1,739
December 2001
avatar

Miran, that's exactly what I'm trying to do, though I'm skipping the tangent part.
And I don't care about finding the exact point of collision, I'm just moving out after calculating the new direction.

Angle is the normal of the collision. (Though pointing in the wrong direction from the start)
Then I get the angle at which the circle is travelling, a.
Then get the difference between those angles, and finally mirror it over the normal.

EDIT:
I've tried playing in school now and it was a bit buggy.
Once, the timer seemed to bork. The red spheres spawned like crazy.
Also, at game over it got stuck in a Game over -> enter hiscore name -> Game over etc infinite loop.

umperio
Member #3,474
April 2003
avatar

Duck Hunter v0.2

Changelog:
- Added duck animation
- Now they come from both sides
- Stripped and optimized dll

Simon Parzer
Member #3,330
March 2003
avatar

Sorry for that, but I was trying to compile v2.01 under Linux with MASkinG 0.79 and it had the following error:

Error said:

MainMenu.cpp:12: error: 'class MAS::ListBoxEx' has no member named 'AreGridLinesEnabled'
MainMenu.cpp:13: error: 'DrawGrid' was not declared in this scope

Has something to do with MASkinG, I suppose... Or do I need the CVS version?

Oncer

miran
Member #2,407
June 2002

@Umperio: Hehe, nice one. I like the ducks. :) But shooting poor little innocent ducks is so cruel :'(:'(:'( :) BTW, you too should replace __declspec(dllexport) with DLLEXPORT so it won't complain on Linux...

Quote:

Has something to do with MASkinG, I suppose... Or do I need the CVS version?

Yeah, looks like it...

Quote:

I've tried playing in school now and it was a bit buggy.
Once, the timer seemed to bork. The red spheres spawned like crazy.
Also, at game over it got stuck in a Game over -> enter hiscore name -> Game over etc infinite loop.

Hmm, more bad news, eh? Sounds like the interaction between the host program and the dll is somehow not working. Btw, I just thought of something. I'll look into it. I just need to reboot to Windows ;)

--------------------------------

EDIT: Another d'oh moment for me. I figured out why I was having those problems with having to win_get_window() and win_set_window(). I was staticlinking the host program!!! Of course it didn't work! Anyway I changed this now so everything works as expected without having to pass window handles around or doing any other such weird stuff. As a result the game class interface changed a tiny little bit. The Init() function now doesn't take any parameters, so everyone working on their games if you'd be so kind please redownload the package and change that. Just delete all the parameters from the Init() function.

Btw, I included all the games that were so far submitted in the version 2.02 release. I hope you don't mind :) The packages are getting rather large though. 1.750k for the Windows binary and 800k for the source+data.... :(

--
sig used to be here

Trezker
Member #1,739
December 2001
avatar

http://trezker.bafserv.net/files/amgc2/sod12.zip

Ok, new version.
Increasing difficulty and an indicator for level of difficulty.
Score now depends on level.
Changed the DLLEXPORT thing.
Draw green/red circle within the blue to indicate max/min radius.

Still no reflection bouncing, but I'm starting to think maybe the gameplay is best as it is already.

I also have another possible feature request.
I'd like to let the user select a starting level before he starts the game.
I wonder if such options could somehow be put together with the game specific control customising you're planning.

miran
Member #2,407
June 2002

Quote:

I'd like to let the user select a starting level before he starts the game.
I wonder if such options could somehow be put together with the game specific control customising you're planning.

I'll add a couple of functions to the IGame interface:

int GetParameterCount();
string GetParameterName(int i);
string GetParameterValue(int i);
void SetParameterValue(string value);

Or maybe there would also be

int GetParameterType();  // string, integer, etc.
int GetParameterIntValue(int i);
void SetParameterValue(int i, int value);

The host program would then create a nice little dialog with edit boxes, sliders, whatever, to update a games configuration.

But maybe that would make it a little tedious to do game configuration. I mean with all those functions and parameter indexes and all that... :-/

Key configuration would be separate from this and handled completely by the host program. Maybe there would just be a way for a game to specify how many keys it needs and how they should be named (instead of "left", "right", "button A", and so on)...

--
sig used to be here

umperio
Member #3,474
April 2003
avatar

Duck Hunter v0.3 is out, ok I didn't receive many comments but I'm having sort of fun working on it.

Since someone ::) complained about it being a bit too cruel, I added a new animation which I hope could solve this issue (at least if you can understand my sprites).
Fixed a ton of bugs, added sound and upgraded to latest amgc2.

That's it, I hope you enjoy it ;)

miran
Member #2,407
June 2002

Quack! :D

Nice little game. Just maybe a little too easy. It needs something to make it a little more challenging but at the same time not too difficult...

--
sig used to be here

nonnus29
Member #2,606
August 2002
avatar

Quote:

I also have another possible feature request.
I'd like to let the user select a starting level before he starts the game.
I wonder if such options could somehow be put together with the game specific control customising you're planning.

Just do it like the old time consoles used too. There's no rule that you have jump straight into the game code. Make a menu and add an 'options' screen the user controls with the direction keys etc...



Go to: