Archive for the 'gpremacy' Category
Gpremacy Update, Hiatus
Gpremacy
I spent most of this week’s free time working on Gpremacy. I’ve implemented Blind Bidding and Turn Randomization, the last major features standing in the way of Gpremacy being a really playable game. The changes are in CVS but they are not ready for serious use yet. For some reason the server-side logic keeps failing at keeping track of who’s playing when. There has to be a subtle problem in the StateManager class. It’s not that big of a class and its job is pretty darn straight-forward, so I’m perplexed at where the error lies. I intended to spend this morning line-by-line debugging it but I was distracted by E.
When I get back from my Spring Break I’ll either do the debugging or simply re-implement the class and see if I get it right next time.
On the plus side, the client code keeps getting better and better. I’ve fixed a number of holes which would cause clients to lock up when connecting to the server. In fact, the only bug I’ve found in the last few days regarding that is so weird that it don’t even throw a useful exception - it just deadlocks. Anyway, I’ll track that one down once I get the Blind Bidding (and probably Loans) fully working.
I’m gearing up to make a serious release very soon - Loans won’t take long at all, and once they’re out of the way the only things not implemented will be Winning Conditions (easy), L-Sat Clashes, Orbital Nuclear Bursts and Amphibious Warfare. Amazingly, these things should all be rather simple, especially in comparison to the Blind Bidding (which required a rewrite of a bunch of the game state management). By “serious release” I mean the following:
- Windows Installer
- Linux Installer (using Autopackage)
- Straight binary (just in case)
- User Manual (already partly written!)
- Turn walk-through (not yet written)
- New website (partly done)
- Developer documentation (just beginning)
I’m also going to bump up to a proper version number this time - the next release will be 0.4.0.
It’s going to be good, very good.
Spring Break
But before I can finish that up, I’ll be heading off to Phoenix and Las Vegas for Spring Break. Yes, Vegas again — we’ll see if Chris can capture another wacky image of me in front of the Paris casino. I’m sure I’ll still be checking my email and cell phone, so you’ll still be able to get in touch with me, just not as quickly.
Finally
My final project for Concurrent Programming is to implement a multiplayer Internet Boggle game using Java. I wrote up a frighteningly complete UML diagram and functionality outline during class today so I think I can say that I’ve a good head start. Don’t worry folks, you’ll get to play this one too.
I anticipate becoming very good at Boggle before this semester is complete…
2 commentsGpremacy Windows installer, Aquarium Simulation…
School’s basically done. I have some RITA work for Software Engineering to do this weekend and I need to put together a video of my Simulation project, but otherwise it’s smooth sailing.
Above you can see a screen-shot of the new installer for Windows I put together yesterday. It uses the Nullsoft Scriptable Installer System and has features to:
- Check for your local copy of Mono. If you don’t have one, it opens your web browser to the Mono download page.
- Create Start Menu shortcuts.
- Create a Desktop shortcut.
- Cleanly uninstalls through a Start Menu shortcut or through the Add/Remove Programs dialog.
That should fix… every problem so far reported for Windows. The next release of Gpremacy will have this installer for Windows. The big feature additions for the next version of Gpremacy will be Blind Bidding and randomized order of play, fixing the old market-manipulation flaw in the original game rules. This is proving to be difficult to get right, so I have no ETA on the next release.
Speaking of that Simulation project above, well, here’s a screen-shot. It’s a simulation of fish, dolphins and sharks (and fish food) in a 3D spherical aquarium. All entities have agent-based artificial intelligences and school, hunt, eat, avoid other species and generally stay alive.
This simulation showcases emergent behaviour - complicated behaviour made up of simpler sub-behaviours.
The boxes at the bottom of the screen have descriptive text when run in Windows, but something strange is happening in Linux. The big button in the center, believe it or not, says “Add Food”. I’m trying to fix this now. The sliders on the left change the coefficients which blend different behaviours of the fishes, and the smaller buttons on the right add more of various species to the aquarium.
It’s rather cool to watch. The fish school around, trying to avoid predators and unfamiliar species. When you add fish food, they go up and feed on it. The dolphins streak around the aquarium eating fish, and the sharks lurk around munching on living targets of opportunity (including dolphins). I’ve faked underwater lighting, so light ripples across their backs as they move. You can rotate the aquarium around and zoom in/out.
It’s a hell of a cool amusement. One of these days I’ll get it on-line for general consumption. ![]()
Tomorrow I’m invited to April’s place for a day of Star Wars. We’re watching all of the movies, 4-5-6-1-2-3. The order that God intended.
Gpremacy listed everywhere!
Aside: I’m home for Thanksgiving, expect slow updates (as has been the case for November already).
Afront: Interestingly, a search on Google for Gpremacy shows that it’s listed several places these days as a viable Linux game. First on Softpedia’s Linux section, next on The Linux Game Tome, briefly mentioned on BoardGameGeek.com and is linked from the Wikipedia entry on the Mono Development Platform. This gives me warm fuzzies.
2 commentsGpremacy Multiplay Release 2
From the website’s statement:
This is even better! The changelog is deceptively short since I forgot to record most of the bug fixes, but there is now a worthless AI opponent, flags to show who owns what, a working movement arrow AND nukes always work when fired! So grab this one and give it a shot. Can you do any less? It’s packaged in a .ZIP file for all of you Windows users out there, too.
Check out the cool screenshot. Ooh, I’m happy it’s turned in so I can go back to making the game better before worrying more about the AI. Comments? ![]()
Short Update
I haven’t really slept since Sunday, so forgive any disjointedness…
I’ve finished the version of Gpremacy and its final report which I am turning in tomorrow. Yes, tomorrow. My adviser, Dave, last week asked me to get everything which he was going to grade into him before Thanksgiving, and since I’m leaving town on Friday… that meant I had to get him everything on Wednesday (he’s not on campus on Thursdays). So I haven’t done much sleeping, instead choosing to code like a maniac and finish writing/editing/proofing the Gpremacy report.
I now have a burned CD with “Gpremacy Version For_Grading” and the report PDF. Tomorrow I’ll take the report to be printed in color (there are two pictures) and turn it all in. Then I take an exam and relax until Friday.
The major change in Gpremacy is that it has an AI which is essentially moronic. It can’t attack or make money, just defend and expand, defend and expand. Even writing that little took a lot of effort. Expect better things later. Right now the AI only works in single player mode, but it won’t take me long to get it working in multiplayer, too.
Now to the real reason I’m making this post, a short anecdote:
I came back from a meeting on campus tonight and entered my apartment like usual. I had a half-empty can of Full Throttle in one hand and my keys in the other. Very casually I went and placed my keys in the refrigerator and dropped the drink on my dresser. It took a few seconds before I figured out why my keys didn’t make a key-jingling sound.
Gpremacy Multiplay Release 1
From the Gpremacy webpage news:
This is the first for-world-consumption release of Gpremacy! Multiplayer support is in and has been tested enough to warrant a release. There are a few defects, but the author can successfully host a complete three-player game across disparate operating system computers. Download at the link below and look at the README file for instructions as to how to run the game (though that is as simple as running mono bin/Debug/gpremacy-mono.exe from the extraction directory).
I’ve also updated the website at http://gpremacy.nongnu.org/, and added Gpremacy to Freshmeat! Hopefully people will start testing and enjoying! Works in Windows! I’ll even make an installer/launcher for it when I get home in December, so you’ll be able to just click an icon and make it work.
I’ll begin writing the AI shortly.
It turns out that since I’m leaving town so early for Thanksgiving, I need to give the “final product” and the “final report” to Dave next week. Luckily, I’ve already written most of the final report. Unluckily, I haven’t written the AI… argh.
On the plus side, I still have my ability to directly metabolize caffeine into glucose. I might be exercising this ability. Also on the plus side, I get to leave Gainesville on the 13th of December. That’s much nicer than, say, the 19th.
2 commentsGpremacy Breakthrough! Attack!
News Flash! Gpremacy works in multiplay!
I just quashed what appears to be the last of the game synchronization issues and I just finished playing a 40 minute long game with myself on two different computers. I won.
Remaining TODOs:
- Additions:
- Amphibious assault
- Blind bid
- Enable Counterattacks
- Bugs:
- Can build ships in occupied seas
- Can unload ships into occupied areas
- L-Sats count as ground units for dice calculations
- Attack screen does not show for defender
- Attacker gets to choose if defender is doing a full defense (!)
I’ll be quashing the bugs the rest of tonight (possibly spilling into tomorrow), then I’ll be cutting another release and updating the Gpremacy website. At that point I’ll be starting on the AI.
3 commentsNetwork Play: Planning Ahead Has Advantages
After ~10 hours of coding, suddenly, Gpremacy has the basics of network play. I’m not kidding - I open a copy on each computer on my desktop, they all connect to a server and units move around the map on each screen! There are a few synchronization issues, and I haven’t coded up selecting which country you wish to play, but the toughest part, getting the data from client to client, is done.
Warning: The following is very geeky!
The truly amazing thing is how simple this ended up being. You see, I planned ahead. Everything in Gpremacy which affects the game state (e.g., everything important) happens in a particular code object called a Command object. These things all have an Execute() method which does their magic, and the game creates a Command object for each action a player takes, and then calls that Execute() function. To make this work for network play all I had to do was send these Command objects to each client and Execute() them there. Sending them to each client was amazingly simple through C#’s BinaryFormatter::Serialize() method.
Keeping everything as a Command object has an additional bonus: implementing an Undo function is trivial.
This is a practical example of the Command Design Pattern’s ability to take names and kick serious arse.
I expect there’s about 10 more hours of work left in multi-play support. Sweet.
Nothing like going from Local -> Network Play in a complicated game in ~ 2 days.
3 commentsGpremacy Update: Game Engine Complete

We’re calling Gpremacy’s game engine “Done enough”. There are flaws and places where the rules don’t line up perfectly, but they’re close enough for now. Notable flaws are:
- No multiplay (yet, that’s next)
- No AI (yet, that’s after multiplay)
- Counterattacks are not offered
- Blind-bid is not implemented for determining order
- Various graphical glitches, like territories and units are not easily marked as to who owns them
I don’t anticipate problems adding either feature in later, but for now the gameplay exists and, well, I have to keep moving! I’m right on my target time to start adding Multiplayer support, so my work for the foreseeable future will be that.
So, with strategic warfare implemented you all know what you want to see, a demonstration! I’ve got one folks, in MPEG-4 format. Mplayer, Quicktime or most copies of Windows Media Player should be able to view this. The strategic battle demonstration (complete with detonation!) can be seen here: Gpremacy, demonstrating strategic attacks, 24 October 2005 (MPEG4 - 512×400, 846 KB). The demonstration was captured with xvidcap. What are you waiting for? Look at the pretty! It’s small and entirely eye-candy!
The tally now is as follows:
- Goal: “Supremacy 3.0″ Rules - Close Enough
- Stage 1A: Pay Salaries and Loans to the Bank - Done
- Stage 1B: Transfer Production Units to Supply Center -Done
- Stage 2: Sell All, Some or None of the Supply Units - Done
- Stage 3: Attack - Close Enough (Needs Counterattacks)
- Stage 3A: Conventional - Done
- Stage 3B: Strategic - Done
- Stage 4: Move armies and/or navies - Done
- Stage 5: Build Forces and Weapons - Done
- Stage 6: Buy or Prospect for Resources - Done
- Goal: Network Play - Not Started
- Goal: Artificial Intelligence - Not Started
Not bad if I do say so. Gpremacy weighs in at 6,295 lines of code, that’s up from 3,631 a month ago. Units move around, load and unload, have appropriate restrictions, conquer territories and fight. Nukes and L-Stars clash, resources are acquired and industries can be turned on or off.
Packages
I’ll be releasing the first ever “release” of Gpremacy tonight on http://gpremacy.nongnu.org/ for limited public consumption. Obviously, things are still in a very beta state, but hell, it’s sorta playable!
It’s about time Gpremacy released packages, it’s been nothing but source since 2002… Theoretically, it should work in Windows if you have Mono installed, but there are dozens of minor path issues that might foul things up. I’ll be glad to help out if things break, just drop me a note. ![]()
Let me know what you think so far, especially of my eye-candy! I’ve waited so long to see a computer-rendition of the little black mushroom cloud pieces in Supremacy…
Gpremacy - Resource Buy/Sale, Movement

An update on Gpremacy, the Game of the Superpowers:
I just finished implementing selling resources to the World Market and buying resources back from the World Market, in other words part of Gpremacy’s stage 6 and all of stage 2 (note that my stages break down differently than those of Supremacy). Additionally, an impressive amount of back-end code is completed now, and the development speed for the general rule definitions keeps increasing. Even the things which further on in this update say “Not Started” have had lots of back-end work already completed. For example, the API for the Artificial Intelligence is being written at the same time as everything below, since I’m using a liberal dollop of the Command design pattern to perform any game state updates.
Also of interest is that I just received my copy of Programming Game AI by Example by Mat Buckland, a book recommended to me by Dave, my project adviser. I’ve barely cracked the book open as of yet, but it both has a good looking first chapter and comes highly recommended, so I hope that it will be my salvation when late October comes along and I’m programming an AI opponent for Gpremacy.
That means the overall project status is:
- Goal: “Supremacy 3.0″ Rules - In Progress
- Stage 1A: Pay Salaries and Loans to the Bank - Done
- Stage 1B: Transfer Production Units to Supply Center -Done
- Stage 2: Sell All, Some or None of the Supply Units - Done
- Stage 3: Attack - Not Started
- Stage 3A: Conventional - Not Started
- Stage 3B: Strategic - Not Started
- Stage 4: Move armies and/or navies - In Progress (calculate pathing)
- Stage 5: Build Forces and Weapons - In Progress (needs to be generic)
- Stage 6: Buy or Prospect for Resources - In Progress (needs prospecting)
- Goal: Network Play - Not Started
- Goal: Artificial Intelligence - Not Started
Presently, Gpremacy weighs in at 3,631 lines of code with little in-line documentation (because of MonoDoc, woo!). It’s also lacking a lot of graphics refinement, but that matters little to me at present — it’s going to be tough enough to simply get the game in a playable state on time. ![]()
It’s fully ready for anyone with a copy of Mono to check out from CVS, build and try. It should even work in Windows (with Mono), but I don’t plan on testing/worrying about that until much later in development.
It really is a labor of love, and it’s a good thing too: this would be a back-breaking workload if I weren’t enjoying this coding!
Solicitation for Assistance:
If any of you have suggestions on a different motto for Gpremacy that stays true to the “feel” of “The Game of the Superpowers”, please post it as a comment!