Mega Ultra Tetris 20XX — Take Two

⌘-R in Chief
Posts: 1,252
Joined: 2002.05
Post: #1
As some of you may remember, I wrote a game back in 2010 for an impromptu weekend contest we had in IRC. The theme was "multiplayer" so I wrote a multiplayer tetris game called Mega Ultra Tetris 20XX in TorqueGameBuilder. It went pretty well, and we (the peeps in IRC) played it often for quite a while afterward. I think ss2cire still plays it. Smile

[Image: MUT20XX.jpg]


So also, as some of you may remember, I said I was writing tutorials for how to get OpenGL running on the Mac, handle events, do texture loading, sound, etc. Well, I recently decided I should get back to working on those, but I came to the conclusion that as I wrote each tutorial and added onto the code of the previous project, I inevitably was going to be rewriting things which would suck if a reader was trying to follow along. Thus, my plan has changed, and I am first going to write the game, then go back and write the guides using code from the game.


Thus, behold Mega Ultra Tetris 20XX is being reborn like a phoenix from the ashes that used to be TorqueScript. Although the game is pretty simple, I thought I'd post some progress updates here in case anyone had the slightest inclination to pretend to care until it's done. Wink


What I have done so far is get the menus up and running, some server/client code, and a little bit of the game code.
  • Thread-safe GL setup in a window
  • Core update/render loop based a la Alex's Time-Based Animation tutorial
  • Event forwarding to a thin generic "scene" stack
  • Texture loading with json config files to specify number of frames in the texture and some other attributes. Loading is done with stb_image.
  • Proportionally spaced font rendering (Jake, it was super easy dude. Took me two hours from scratch Wink) using the AngelCode font format (which I had never heard of before, but seems to be popular and is used by Glyph Designer which I'm using)
  • Some basic GUI items - Labels, Buttons, and a bg panel so far.
  • Some Networking code such that a client can connect to a server and they can talk to each other in a specified protocol.

The approach I'm taking to this entire project is that everything is in Objective-C and is Mac-only focused for the time being. I'm doing my best to keep a reasonably strict separation between code that's specific to the game, and code that's generic such that the generic code can be copied and immediately useful to start a new project. I am not attempting to write an all-encompassing game engine, but instead am trying to create a collection of useful code which solves individual problems. i.e., proportional text rendering, playing music, a simple abstraction over sockets, etc. You could easily take any one of these little chunks and use it in your code.

Anyway, we'll see how it goes. One way or another the game will be finished and the code and guides to follow will be useful to newcomers. After I get it to a point where the game actually runs, I'll be throwing this up on iDG's github account, and you guys can tear into me, err, it. Rasp
Quote this message in a reply
⌘-R in Chief
Posts: 1,252
Joined: 2002.05
Post: #2
Tonight's progress was to get the first player (aka host) connecting to the server and the lobby screen displaying players and their status.

[Image: MUT2-1.png]
Quote this message in a reply
Moderator
Posts: 771
Joined: 2003.04
Post: #3
(May 5, 2012 09:36 PM)SethWillits Wrote:  After I get it to a point where the game actually runs, I'll be throwing this up on iDG's github account,

Any idea as to what license would you release it under?
Quote this message in a reply
⌘-R in Chief
Posts: 1,252
Joined: 2002.05
Post: #4
The Do Whatever You Want With It Except Don't Copy It Verbatim And Sell It On The App Store license.
Quote this message in a reply
⌘-R in Chief
Posts: 1,252
Joined: 2002.05
Post: #5
Today's progress:
  • Multiple clients successfully connect to the server.
  • The lobby works. Players can toggle their "Ready" status and it's seen by others.
  • The game can now be started and blocks fall! All movement works.

[Image: MUT2-2.jpg]


Boards aren't replicated to other players yet though. That'll be next. It'll be really simple, actually. Then from there it's detecting a winner when everyone else loses, and doing the Game Over / You Win animation stuff and the game will be fully functional. Then it'll just be a matter of finishing the menus and adding sounds.

I should probably make real art for the background instead of still using the TGB fish demo art. Wink
Quote this message in a reply
Moderator
Posts: 623
Joined: 2007.09
Post: #6
Wow Yessss. I was seriously going to see if anyone was still playing this the other day - it looks awesome as ever.

- Lincoln Green
http://www.binkworks.com/
Quote this message in a reply
Moderator
Posts: 452
Joined: 2008.04
Post: #7
Awesome! My name is even in the screenshots!

Howling Moon Software - CrayonBall for Mac and iPhone, Contract Game Dev Work
Quote this message in a reply
Sage
Posts: 1,482
Joined: 2002.09
Post: #8
Well, it looks pretty cool, but I would have went with a steam punk look instead of an underwater one. It gives you a lot more gameplay options for powerups. Like you could do steam based powerups instead of like... starfish ones or something. You know what I mean?

Other than the lack of a steam punk theme, it looks like a pretty cool example project. Rasp

Scott Lembcke - Howling Moon Software
Author of Chipmunk Physics - A fast and simple rigid body physics library in C.
Quote this message in a reply
⌘-R in Chief
Posts: 1,252
Joined: 2002.05
Post: #9
(May 9, 2012 07:15 AM)AndyKorth Wrote:  Awesome! My name is even in the screenshots!

Omg! Are you Player 949??!!


Quote:Well, it looks pretty cool, but I would have went with a steam punk look instead of an underwater one.

Literally the only reason it has underwater art is because I did the fish tutorial then immediately jumped into making tetris (in the original version). Smile

http://www.youtube.com/watch?v=0x1K6YKIH0M

I'll be replacing it later on, but it'll be less themed and more cleaned. I can't make "art" per se.
Quote this message in a reply
⌘-R in Chief
Posts: 1,252
Joined: 2002.05
Post: #10
So last night I spent a couple hours on it. Progress to report:
  • Completed lines now zap away
  • If you spill over the top, you die
  • All movement is now replicated through the server
  • It detects the end of the game (only one player left) and stops the game and declares a winner via NSAlert. Wink

[Image: MUT2-3.jpg]

Yes, each piece currently has a random color.
Quote this message in a reply
Moderator
Posts: 384
Joined: 2002.08
Post: #11
Awesome job! A great starter project for people to get their feet wet (ha, ha, ha... maybe an argument to keep the water theme, actually).

KB Productions, Car Care for iPhone/iPod Touch
@karlbecker_com
All too often, art is simply the loss of practicality.
Quote this message in a reply
⌘-R in Chief
Posts: 1,252
Joined: 2002.05
Post: #12
On Saturday I got a little more work done.
  • Added sound effects and music.
  • Drawing the next shape for the local player.
  • End of game shows You Win / Lose and then auto-transitions back to the Lobby on server's command.
  • Made a basic editable text field, and being able to click on them to edit etc. It all works though I have a small problem with text scaling at the moment.
  • Working on getting Host / Join screens with controls.

[Image: MUT2-4.png]

Doing GUI layout in text really really stinks. I want a visual editor so much. Smile
Quote this message in a reply
Moderator
Posts: 384
Joined: 2002.08
Post: #13
Woohoo! Keep going.

I will say... I'm not a big fan of coloring in the capital letters, and leaving lowercase as clear... but you're working with whatever font you got, I understand Smile

KB Productions, Car Care for iPhone/iPod Touch
@karlbecker_com
All too often, art is simply the loss of practicality.
Quote this message in a reply
⌘-R in Chief
Posts: 1,252
Joined: 2002.05
Post: #14
Obviously that's ugly. I just haven't changed the font sheet yet because I'll have to manually edit it or just pick a different font. I'm not making it pretty yet, just functional.
Quote this message in a reply
⌘-R in Chief
Posts: 1,252
Joined: 2002.05
Post: #15
Alright this past weekend I spent a day working on MUT again, mostly little things.
  • I spent some time working on the text field adding different scaling modes (the frame resizes to fit the text, the text resizes to fit within the frame, or the text is clipped by the frame)
  • Read-only fields, and editable fields can now have a allowedCharacterSet which is the set of characters allowed to be entered. (So this lets you limit to numbers only, or whatever.)
  • Fully implemented the Host and Join screens
  • Fixed some bugs in disconnection

After that, I decided to try fiddling with a new look. Here's what I've come up with so far.


[Image: MUTII-5.png]
[Image: MUTII-6.png]

There's currently a little bug which is calculating the ascent/descent incorrectly for some letters. I haven't tried to find that yet, but it'll be pretty simple.

I've come to the conclusion that making nice looking tiles is actually pretty difficult. I tried a few variations and I just can't get something I like. I'll keep fiddling.

[Image: MUTII-7.png]
Quote this message in a reply
Post Reply