|
|
| [Community Project] AMGC2 |
|
Indeterminatus
Member #737
November 2000
|
What about a simple chess game? _______________________________ |
|
Evert
Member #794
November 2000
|
Already suggested. |
|
Indeterminatus
Member #737
November 2000
|
Evert said: Already suggested.
Sorry, I must have missed that. Anyway, I'm looking forward to it _______________________________ |
|
miran
Member #2,407
June 2002
|
Quote: Miran, if you are serious about the network play, I have two turn-based multiplayer games that I could port to the AMGC2 model (they are Magic Maze and Hexagon, from my site). I don't have any expertise to offer on how to implement the server etc. but these two games will be useful to have something for testing. And I'll help with testing, of course. Yes, all entries are welcome. Eventually changes will be made to the IGame interface to allow network games to be developed, but that shouldn't stop you from making a game that will work without network support which can be added with little effort later. Quote: Are you aiming only at turn-based games? I recommend you do. Lag will be less of an issue, and it would be more feasible to have a single server that suits the needs from all allegroids all over the world. For real time games that would be impossible, and you'd end up with many regional servers with too few people logging in to make it interesting. Yes, right now the focus is on turn based games like chess and turn based strategies. I wouldn't mind having a system capable of handling simple action games as well but that's not a priority. Btw, I'm not working on the hardcore network code myself. There's a secret contributor in this project who wants to remain anonymous for the time being, at least I assume so, otherwise he would have already posted in this thread. Oh and with the whole weekend in front of us I hope to get some serious work done in the next 48 hours or so. -- |
|
Audric
Member #907
January 2001
|
Suggestion: generic Load / Save buttons? Not sure, because realistically, I don't expect many people will code games which require those. I suggest it anyway because the framework allows to unify their look-and-feel as well: Generic "Save" / "Load" windows with 10 slots, calling virtual Save(FILE *) and Load(FILE *) methods, plus a Save_query() returning false if 'this is not the right moment to save') Miran, if you succeed in bringing netplay into reality, this will be tremendous achievement as a learning tool for programmers. In my opinion, it's already a very good introduction to OO programming, as it's one of the very few examples I've seen, where derived functions show a purpose. It also teaches the programmer to separate display from logic, and store his current-game-in-progress-info in one place... Useful habits. I'm really eager to be able to write a Logic() function which first 'checks the inbox' for the messages which arrived since last update. Turn-based would still be the easiest to program, but even "action" games based on 1-second units would still be very playable, like for example a 2-player Dungeon Master / Roguelike. Such games should implement the my-turn / your-turn system, except each game sends a no_action message when a time_out is reached. (This is to ensure the 2 players won't collide) |
|
miran
Member #2,407
June 2002
|
About the load/save functions... that would be very easy to implement for me. But on the other hand, if a game requires those functions, it's probably not a "minigame", although for games like your Blocks it would be useful. Btw, I played your game quite a bit. Couldn't get past level 40 for some reason. There's more than half hour of gameplay in there, although the first levels really are very easy... Umperio said: Fixed small issues and so version 0.4
Did you forget to put the source in the zip? I don't mean to say that you have to release the source, but those of us who are in Linux really can't play the game -- |
|
Ilyas Salman
Member #6,762
January 2006
|
I present my first game with allegro: It's a little ping pong game with strike feature: When your bat moves and the ball collides, the ball's direction is manipulated by the bat's direction. Now, I'll work for the basic .exe program of the same game. Screenshot=attachment. The game is 1 Mb (compressed), because the background (bmp), made with mapgen 1.1. |
|
miran
Member #2,407
June 2002
|
I appreciate the effort - It doesn't work. The ball constantly travels only along the top edge of the screen and when you try to hit it, it gets stuck until you move the paddle away. (see attached screenshot) - At 1MB it hardly qualifies as a minigame (just like my dart game - There's no source. Luckily I'm in Windows right now so I could play it, but most times I'm in Linux (as are quite a few other people) so I really would need the source. -- |
|
umperio
Member #3,474
April 2003
|
Oops I just forgot about it, I'm really sorry. I reuploaded the complete package. You have to forgive me, I'm still a linux beginner |
|
Evert
Member #794
November 2000
|
Ok, I've hacked my (old) chess-programme into working with the interface. I didn't have to touch the actual chess-code at all, which was good (I wrote it with that in mind). The only thing I've disabled is the `ponder' feature: allowing the computer to think while you are thinking. To get it working, uncomment a few lines and compile the source again with pthreads enabled. The interface itself is a pretty ugly hack though: I copied most of the code from my original quickly hacked-together interface and beat it until it compiled and worked. This means that right now you cannot change any settings (such as the maximum searchdepth and how long the computer thinks; these are hardcoded at 12 ply and 10 seconds). Worse, it bypasses the interface's input method, which means that you don't get keyboard shortcuts, which means that you also cannot take back any moves. I remember that there were a few things that I wanted to clean up and implement in the chess programme itself (mainly having to do with move generation and move ordering in the generator), but the current programme at works. EDIT: as for compiling, just unpack the code and run `make'. That should build it correctly for either Windows or *nix, but I haven't actually tried it in Windows. |
|
miran
Member #2,407
June 2002
|
Looks great - in the logic function set a flag That is if the thinking function has a loop that can be interupted and then continued like that... Btw, on Windows I had to change the makefile so it runs g++ instead of gcc... -- |
|
Fladimir da Gorf
Member #1,565
October 2001
|
Quote: Probably no. Besides, OpenLayer doesn't work on Linux. At least not on mine... You mean, OpenLayer 2.0 doesn't compile because the compiler doesn't understand a function definition? The CVS version compiles for Linux as well. OpenLayer is not platform specific in any single way... That's why it uses supporting libraries which are cross platform. OpenLayer has reached a random SVN version number ;) | Online manual | Installation video!| MSVC projects now possible with cmake | Now alvailable as a Dev-C++ Devpack! (Thanks to Kotori) |
|
Evert
Member #794
November 2000
|
Quote: That is if the thinking function has a loop that can be interupted and then continued like that... That's the thing. It can't; at least not easily. The computer uses the mini-max algorithm (in the form of alpha-beta, for those who want to know) to generate a score for each move in the current position. It does this first for one ply, then for two ply... etc., until the maximum searchdepth has been reached, or the time expires (whichever comes first). I'll see if I can easily get it to work using a separate thread. It shouldn't be too difficult, I think. |
|
miran
Member #2,407
June 2002
|
Quote: You mean, OpenLayer 2.0 doesn't compile because the compiler doesn't understand a function definition? The CVS version compiles for Linux as well. OpenLayer is not platform specific in any single way... That's why it uses supporting libraries which are cross platform. I mean it requires GlyphKeeper which requires FreeType 2.1.10 while I have 2.1.9 and upgrading apparently involves having to use some form of black magic. Quote: I'll see if I can easily get it to work using a separate thread. It shouldn't be too difficult, I think. Yeah, that would be best, I think... -- |
|
amarillion
Member #940
January 2001
|
Attached: v0.95 of the Pacman minigame. Changes since v0.90 I haven't had any hangs or crashes in a while now, the responsible bug must have been silently fixed while cleaning up the code. If you find otherwise, please let me know. -- |
|
miran
Member #2,407
June 2002
|
Excellent. Doesn't hang anymore... -- |
|
Fladimir da Gorf
Member #1,565
October 2001
|
Quote: I mean it requires GlyphKeeper which requires FreeType 2.1.10 while I have 2.1.9 and upgrading apparently involves having to use some form of black magic.
You could of course compile it with -DOL_NO_TTF and use an another way to render text... But it's true that then other's OL code might not work for you if it uses the text routines OpenLayer has reached a random SVN version number ;) | Online manual | Installation video!| MSVC projects now possible with cmake | Now alvailable as a Dev-C++ Devpack! (Thanks to Kotori) |
|
Audric
Member #907
January 2001
|
1) I'm a bit worried by the way settings are handled. In my game, I malloc a fresh GameSettings structure in the creator of my Actually, if settings usually work OK today, it's a friggin miracle, as I can't Anyway, this probably explains why the settings randomly disappeared sometimes, 2) I found a memory leak, but it's unrelated: the IGame created in 3) During 'pause' (ESC), the keys[] array is freshly allocated and 4) About network: I realize I will probably never code a network game if I can't |
|
Evert
Member #794
November 2000
|
Quote:
4) About network: I realize I will probably never code a network game if I can't Run the server and the client on the same machine and have the client connect to localhost (127.0.0.1). No emulation required. |
|
Seppl
Member #4,656
May 2004
|
[offtopic] Quote: Run the server and the client on the same machine and have the client connect to localhost (127.0.0.1). No emulation required. well... some time ago I was programming a network game using localhost to test it and when I wanted to test it via LAN, it simply did not function and i couldn't figure out why... I borrowed a second computer so i could test it at frequent intervals via LAN and rewrote the whole thing and now it's working... Just to say that I have made some bad experience using localhost... __________________________________ |
|
amarillion
Member #940
January 2001
|
Quote: Run the server and the client on the same machine and have the client connect to localhost (127.0.0.1). No emulation required. This is exactly what I suggested before, IMHO the way to go. No need to have extra ethernet cards. Granted, this is not the real life situation with all the extra headaches of dealing with lag, lost connections, etc. But it would be good enough to help test and develop the games themselves. -- |
|
miran
Member #2,407
June 2002
|
Audric: Thanks for the bug reports! 1. You must be looking at an old version of the source because I already fixed that in 2.08. 2. It is indeed a memory leak and easy to fix. Thanks. 3. Same as 2. 4. Network code is being worked. Once there is sufficient progress, the API and the server will be released. You will then be able to setup a development configuration, be it on one computer (using localhost), a small network or any other way you can. There will also be at least one public server. -- |
|
Audric
Member #907
January 2001
|
miran said: 1. You must be looking at an old version of the source because I already fixed that in 2.08. Arrrggghhhhh this took the best part of Sunday for me to make sense, it was making me crazy. The other problem in pause mode was seen only before 2.7 indeed, since it forced me to implement a "paused" flag, I couldn't see if it was still there afterwards. Network: The way I understand it, the central "public server" is for taking care of the chat room &| list of active servers. When you start a Pong server however, it should do 2 things at the same time: Clients connecting to the central server would only query it for list of open game servers, which would list the servers which have not timed out. IMO, the chat room should be a standard IGame with 10+ "players". This would be a simple yet nice showcase and code example. |
|
miran
Member #2,407
June 2002
|
Those are some interesting ideas, especially the one with the chatroom being an implementation of IGame. But I think I'll keep it the way it is suggested in v2.08. I want the chatbox to be a reusable kind of widget so that you would still be able to talk with the other players if you wanted to while playing. As for the server/client architecture of the system, I thought everything would be done through the central server. The server would keep a list of players and active games, the clients would send messages to the server and it would rout them to their destination. This probably wouldn't work for fast action games or situations where there are a lot of active games at the same time, but I think that won't be much of a problem... -- |
|
Audric
Member #907
January 2001
|
I discarded the idea of a central server distributing network packets, as : miran said: I want the chatbox to be a reusable kind of widget so that you would still be able to talk with the other players if you wanted to while playing.
Amgc2 can easily call an IGame function, but IGame functions cannot easily call an amgc2 thing. Especially if it's a MASking widget contained in an Amgc class - this requires linking with amgc and masking, which kind of breaks the concept of plug-in games. edit Now I think I see a possible plugin-safe implementation: a key bringing down the full amgc2 box with history as a pop-up over the game (like in pause mode), and a virtual |
|
|
|