GDR Forum Index
Podcast Podcast
Dev Dev Logs
Search Search
RSS RSS
Register Register
Log in Log in
Reply to topic GDR Forum Index -> Game Developer's Refuge -> Development Log - ASCII Game [Demo 2 out] Page 1, 2, 3, 4, 5  Next
View previous topic :: View next topic  
Author Message
mikedoty
Developer

Joined: 18 Mar 2006
Posts: 1788

PostPosted: Wed Jan 09, 2008 2:12 am    Post subject: Development Log - ASCII Game [Demo 2 out] Reply with quote

Look, a picture!

screenshot

Look, a link to a short gameplay teaser video!

http://www.dailymotion.com/psyguy1/video/6711618

Look, it's late. More words and maybe more media next time! :P
_________________
The end of the game, yes, is pretty much getting the weapon and killing off the population.
mashup games . com | Finally! - A Lode Runner Story


Edited by mikedoty on Thu Jun 04, 2009 2:32 pm; edited 1 time
View user's profile Send private message Visit poster's website AIM Address
sonrisu
Moderator

Joined: 31 Aug 2005
Posts: 4977
Location: Silicon Valley!
PostPosted: Wed Jan 09, 2008 4:30 am    Post subject: Reply with quote

Haha! That's cool. The player is kind of wide, though and looks weird hanging off of things. Anyway, is this all done in realtime, character by character, or are you just using bitmaps that happen to consist of art created with ASCII characters?
_________________
loomsoft :]
View user's profile Send private message Visit poster's website
NyanNyanKoneko
Contributor

Joined: 19 Oct 2005
Posts: 450
Location: In your L1 CPU cache
PostPosted: Wed Jan 09, 2008 4:32 am    Post subject: Reply with quote

I vote mikedoty for President.
View user's profile Send private message Visit poster's website
Sirocco
Moderator

Joined: 19 Aug 2005
Posts: 9410
Location: Not Finland
PostPosted: Wed Jan 09, 2008 5:23 am    Post subject: Reply with quote

Very cool. Reminds me a lot of Below the Root, which makes me happy.
_________________
NoOP / Reyn Time -- The $ is screwing everyone these days. (0xDB)
View user's profile Send private message Visit poster's website
sonrisu
Moderator

Joined: 31 Aug 2005
Posts: 4977
Location: Silicon Valley!
PostPosted: Wed Jan 09, 2008 5:33 am    Post subject: Reply with quote

That game sounds awesome. I wonder if I can find it anywhere. If you have any tips, PM me. I'd rather not derail this thread with that kind of discussion.
_________________
loomsoft :]
View user's profile Send private message Visit poster's website
Madgarden
Contributor

Joined: 31 Aug 2005
Posts: 324
Location: Kitchener, ON, CA
PostPosted: Wed Jan 09, 2008 7:34 am    Post subject: Reply with quote

Looks sweet and funky! XD
_________________
I know it sounds crazy, but it JUST MIGHT WORK
View user's profile Send private message Send e-mail AIM Address Yahoo Messenger MSN Messenger
PoV
Moderator

Joined: 21 Aug 2005
Posts: 10781
Location: Canadia
PostPosted: Wed Jan 09, 2008 9:02 am    Post subject: Reply with quote

Wild. Totally unexpected. Bravo.
_________________
Mike Kasprzak
'eh whatever. I used to make AAA and Indie games | Ludum Dare | Blog | Tweetar
View user's profile Send private message
mikedoty
Developer

Joined: 18 Mar 2006
Posts: 1788

PostPosted: Wed Jan 09, 2008 10:41 am    Post subject: Reply with quote

sonrisu wrote:
Haha! That's cool. The player is kind of wide, though and looks weird hanging off of things. Anyway, is this all done in realtime, character by character, or are you just using bitmaps that happen to consist of art created with ASCII characters?


The player is actually the one stolen thing right now. I might still make the player a frog, but this frog is a FAKE! Well, a stolen frog. :)

As for the rendering, I don't have prerendered bitmaps but I don't render character by character either. I guess I combine the two approaches. :) I initially rendered everything on a character-by-character basis, but that approach led to much slowdown with about 3 trees and a few apples. :P

After not too long I realized the foolishness of my character-by-character characters and decided to render each object to a texture at run time. Now it runs very nicely. Performance-wise, anyway. :P I kind of thought of it as cheating for a fleeting moment, but then I realized the player won't notice any difference between the slow rendering approach and the good rendering approach! =)

I'll talk just a little bit about the code behind it to make it more of a development log than a ... picture log. Most of it obviously isn't too fancy. Right now I don't plan to actually have anything tile-based. Each "letter" has dimensions of 9 pixels wide by 10 pixels tall. Though I think I've done a nice job of coding this pretty cleanly, I admit I've hard-coded that 10 x 9 in a few places. Sorry! :P

In addition to making for a neat little ASCII game, I think I'll have the chance to use this engine to make other cool games as well (thus some of the extra care I've taken to make things nice and clean).

Oh, I meant to mention in regards to the character-by-character prerendered topic that I store each object in a small text file. Most objects have an accompanying color file in which I define the various colors it has and then define which tile has which color. You might have something like this:

Code:
[b]grass.txt[/b]
##########
##########
##########


Code:
[b](color)grass.txt[/b]
1 = #00FF00
2 = #804000 (don't remember what the exact code I use is)
== end of color definition == <-- I use this line to tell the object loader to stop loading color definitions and to proceed to load the color data.
1111111111
2
2


So, that's how I'm defining my objects. I call each of these objects a "prototype" in my code. I don't know if that makes any sense or not. :P Then, instead of prerendering a texture for the ground in every place I use the ground, I instead only keep one copy and then call that prototype as many times as I need to. For instance, if I have 3 "ground" objects, then I'll create 3 objects of type "ground" and give them x coordinates of, say, 0, 200, and 400. Then I'll call the "draw" member function of the prototype and pass along the coordinates of the location at which to draw it. When I want to create an animated object, I create a small wrapper class (basically) that holds a list of prototypes and draws the one that matches the current frame.

One last interesting feature is the tile-perfect collision detection. When testing collision, I first do the standard general rectangle intersection test. Then I check the two objects on a tile-by-tile basis to see if a true collision occurred. I generate a set of "sub"rectangles for each prototype at the time of the prototype's creation. (I just loop through and create widest-possible rectangles on each row and then combine like-widthed rectangles that border each other vertically.) This lets me make objects such as hills or staircases into one singular object instead of multiple objects which saves time. It also makes for more precise collision detection I guess, but I really just consider that a fringe benefit. Do I too obviously care more about making my job easier than about making the player's job easier? :P I do have one exception where I'll force the object to skip this tile-perfect collision detection (and just have one large bounding rectangle without subrectangles), but I can't give away all of the surprises yet (even the ones you have already seen before from me)! :P
_________________
The end of the game, yes, is pretty much getting the weapon and killing off the population.
mashup games . com | Finally! - A Lode Runner Story
View user's profile Send private message Visit poster's website AIM Address
sonrisu
Moderator

Joined: 31 Aug 2005
Posts: 4977
Location: Silicon Valley!
PostPosted: Wed Jan 09, 2008 11:20 am    Post subject: Reply with quote

That's a pretty cool idea for making what appears to be a realtime rendered ASCII game. What kind of speed hit do you get on loadup for those objects that we saw in the video?
_________________
loomsoft :]
View user's profile Send private message Visit poster's website
mikedoty
Developer

Joined: 18 Mar 2006
Posts: 1788

PostPosted: Wed Jan 09, 2008 11:41 am    Post subject: Reply with quote

No speed hits at all. :) Even my Geforce 4 MX can handle 2 or 3 digit polygon counts without too much trouble! :P
_________________
The end of the game, yes, is pretty much getting the weapon and killing off the population.
mashup games . com | Finally! - A Lode Runner Story
View user's profile Send private message Visit poster's website AIM Address
Sirocco
Moderator

Joined: 19 Aug 2005
Posts: 9410
Location: Not Finland
PostPosted: Wed Jan 09, 2008 12:05 pm    Post subject: Reply with quote

I once saw a 3D demo that features an ASCII shader. Pretty neat stuff.
_________________
NoOP / Reyn Time -- The $ is screwing everyone these days. (0xDB)
View user's profile Send private message Visit poster's website
sonrisu
Moderator

Joined: 31 Aug 2005
Posts: 4977
Location: Silicon Valley!
PostPosted: Wed Jan 09, 2008 12:54 pm    Post subject: Reply with quote

So, you didn't disclose how you're writing this. I'm assuming it's in Python?

I also noticed you like to reuse that cursor in almost all of your games. :P
_________________
loomsoft :]
View user's profile Send private message Visit poster's website
mikedoty
Developer

Joined: 18 Mar 2006
Posts: 1788

PostPosted: Wed Jan 09, 2008 1:17 pm    Post subject: Reply with quote

Oh, right, definitely Python for this, with openGL as well.

And yes, that's like my personal mouse cursor I guess. I think I used something different for the Bulldozer game I have on the backburner, though. :P
_________________
The end of the game, yes, is pretty much getting the weapon and killing off the population.
mashup games . com | Finally! - A Lode Runner Story
View user's profile Send private message Visit poster's website AIM Address
mikedoty
Developer

Joined: 18 Mar 2006
Posts: 1788

PostPosted: Fri Jan 11, 2008 2:25 am    Post subject: Reply with quote

Time for another video!

This one clocks in at over 10 minutes, so you might want to keep your remote control handy. It features some new gameplay elements, but it focuses on demonstrating the level editing process. I spend a lot of time today improving the user interface (for myself, selfishly!) and I think I did a pretty nice job.

I'll talk a little bit next time about the new stuff in the video, which goes pretty well until the last 30 seconds or so when (a) I accidentally brush the mouse off the screen and it briefly triggers the adjacent workspace and (b) I find that I screwed up the level slightly and have to cheat to "win." :P

He he, good thing I have an edit button - http://www.dailymotion.com/psyguy1/video/x40in7_asciigameplay2_videogames
_________________
The end of the game, yes, is pretty much getting the weapon and killing off the population.
mashup games . com | Finally! - A Lode Runner Story
View user's profile Send private message Visit poster's website AIM Address
sonrisu
Moderator

Joined: 31 Aug 2005
Posts: 4977
Location: Silicon Valley!
PostPosted: Fri Jan 11, 2008 5:08 am    Post subject: Reply with quote

That editor looks really, really cool. I like how it runs the game engine while you're editing, both at the same time. In my editor I stop the game engine, but it wouldn't be hard to push back in the editor logic as well. Unfortunately, usage of the editor requires the pressing of keys that are also used to move the player, so if I wanted to I'd have to do some magic to work that out (which I don't want to do).

I think it might be a bit of a pain in the ass to place level objects and line them up; but then again, isn't placing tiles just as bad? You need some sort of quick selection. The only thing I see as detrimental with objects as opposed to tiles is you can easily see which tile you want to place. With objects you have to go by name. I think the next step up in your editor is to have a "visual picker" for the objects that you want to place.

Lastly, I like your event boxes. The only detriment I see is you cannot tell the boxes where to place the player on a level load. It looks like it puts the player wherever they were when the level was saved. If you're not going to have levels that are linked together (eg: you can move back and forth between them), then this is fine. If you want to be able to come back to some map, though, how is that going to work when ti simply places the player where they were when the map was saved? I don't think it would. Do you have plans to allow moving between maps in both directions? I'm curious how you're going to handle placement of the player in that case. Just select a position? This gets into the whole deal I tackled with my portals to allow for things to look smooth on map transitions. That said, I don't know what you're planning to do with the game (if it's going to be a classic platformer where you can't go back to old levels, etc).

All in all, really cool. Nice crates. ;)
_________________
loomsoft :]
View user's profile Send private message Visit poster's website
JackDark
Contributor

Joined: 31 Aug 2005
Posts: 229

PostPosted: Fri Jan 11, 2008 8:21 am    Post subject: Reply with quote

It's funny that Sirocco thought "Below The Root" because that's the first thing I thought too.

Compliment though considering.
View user's profile Send private message
mikedoty
Developer

Joined: 18 Mar 2006
Posts: 1788

PostPosted: Fri Jan 11, 2008 12:49 pm    Post subject: Reply with quote

sonrisu wrote:
Unfortunately, usage of the editor requires the pressing of keys that are also used to move the player, so if I wanted to I'd have to do some magic to work that out (which I don't want to do).


I know it depends on how you have your input checking set up, but perhaps you could just do something like this?

Code:
if (not_editing_map) {
    /* Check keyboard / etc. */
}


I usually do something like that. You could probably do better than to emulate what I do, though. :P

Quote:
I think it might be a bit of a pain in the ass to place level objects and line them up; but then again, isn't placing tiles just as bad? You need some sort of quick selection. The only thing I see as detrimental with objects as opposed to tiles is you can easily see which tile you want to place. With objects you have to go by name. I think the next step up in your editor is to have a "visual picker" for the objects that you want to place.


A visual selection process sounds like a good idea. I'll have to put some thought into how I want to do it.

Quote:
Lastly, I like your event boxes. The only detriment I see is you cannot tell the boxes where to place the player on a level load. It looks like it puts the player wherever they were when the level was saved. If you're not going to have levels that are linked together (eg: you can move back and forth between them), then this is fine. If you want to be able to come back to some map, though, how is that going to work when ti simply places the player where they were when the map was saved?


I'll definitely have a process to place the player conditionally. You'll have the ability to into a house, for instance, and then appear back in front of the house when you return to the map. I should have that working pretty soon.

Now for a short discussion of the new things from the video...

First you'll obviously notice that I've changed the main character into a monkey. I wouldn't call it the prettiest monkey ever, but it does look like a reasonable facsimile of a monkey, so it works for me. :P The monkey animates and all that.

I also demonstrated the aforementioned event box system. Whenever I want to set up an event (reading a sign, entering a new level, level fades, etc.), I'll set up an event box. I can make them in any size but in only one shape. Then I link the desired event(s) to the box.

Later on you see the introduction of "icy ground" into the game. I give every object in the game a "slide" attribute. The slide attribute determines the slickness of each surface. As you'd imagine, most surfaces keep the default of 0. The icy ground, though, has a higher slide attribute; this results in the player... well... sliding more on the surface. :)

Similar to the slide attribute, I also define a friction attribute for each object. Again, most objects have no friction value. However, an object such as the demonstrated conveyor belts will indeed have a friction attribute. When anything is sitting atop an object, it will move laterally according to that friction variable. Also, objects will "remember" the friction of any object they touch so that a third object on top of the moving object will also move. For instance, in the video the player jumps on top of a crate. The crate is sliding along a conveyor belt, and the player moves along with the crate.

The video introduces one other new gameplay element: ducking. Believe it or not, I have never implemented a "ducking" feature into any game I have made. Why? I have no idea. I just haven't. :P Sometimes you'll need to duck to advance beyond certain areas, as the video illustrates. (And sometimes you have to move an object out of the way because you can't even duck under it. Oops! :P)

I think that covers most of the new stuff for now. Maybe something more interesting than a video next time... :P
_________________
The end of the game, yes, is pretty much getting the weapon and killing off the population.
mashup games . com | Finally! - A Lode Runner Story
View user's profile Send private message Visit poster's website AIM Address
PoV
Moderator

Joined: 21 Aug 2005
Posts: 10781
Location: Canadia
PostPosted: Fri Jan 11, 2008 3:31 pm    Post subject: Reply with quote

I'm so jealous. Your editor has context menus. Not to mention, it's real-time. :(
_________________
Mike Kasprzak
'eh whatever. I used to make AAA and Indie games | Ludum Dare | Blog | Tweetar
View user's profile Send private message
Madgarden
Contributor

Joined: 31 Aug 2005
Posts: 324
Location: Kitchener, ON, CA
PostPosted: Fri Jan 11, 2008 11:02 pm    Post subject: Reply with quote

Real-time live-coding environment sort of, WOO!
_________________
I know it sounds crazy, but it JUST MIGHT WORK
View user's profile Send private message Send e-mail AIM Address Yahoo Messenger MSN Messenger
mikedoty
Developer

Joined: 18 Mar 2006
Posts: 1788

PostPosted: Sat Jan 12, 2008 2:37 am    Post subject: Reply with quote

10 more tantalizing minutes of level editor stuff with a little gameplay mixed in.

http://www.dailymotion.com/playlist/xaoqw_psyguy1_gameplay-3-playlist/video/x40uq9_asciigameplay3_videogames

I forgot to add fade-in events in an important spot, hence the need for a 2nd part to the video. :P
_________________
The end of the game, yes, is pretty much getting the weapon and killing off the population.
mashup games . com | Finally! - A Lode Runner Story
View user's profile Send private message Visit poster's website AIM Address
sonrisu
Moderator

Joined: 31 Aug 2005
Posts: 4977
Location: Silicon Valley!
PostPosted: Sat Jan 12, 2008 6:34 am    Post subject: Reply with quote

Quote:
I know it depends on how you have your input checking set up, but perhaps you could just do something like this?

That is what I do. What I was trying to say is that I don't run the actual game logic while the editor is running at the same time. Switching to the editor halts the game. I'm considering doing some hackery where you can actually flip game logic processing on or off on the fly while in editing mode. I think being able to halt game processing while editing is a must: as sometimes you'll want to place items/objects that move around, and you don't want them moving around to different spots before you save your level out.

Pretty cool with the video. It can get a little boring watching plain editing without seeing what things do. It looks like you had some sort of scripting or code editing straight inside the events. It was hard to read what they said, though. I noticed it had indentation among other things, is that being dumped as straight python that's eventually being run--or are you doing something else interesting?
_________________
loomsoft :]
View user's profile Send private message Visit poster's website
mikedoty
Developer

Joined: 18 Mar 2006
Posts: 1788

PostPosted: Sat Jan 12, 2008 12:11 pm    Post subject: Reply with quote

Yep, I know a person can only watch so much level editing video before falling asleep. :P I didn't meant to make this one so long, but it turned out that way I guess. If it were more interesting I'd link the original AVI to make the words more legible. :P

I wish I could narrate these things (I tried on the previous editor one), but whenever I use the "record sound" option on the screen capture program (Istanbul), it freezes up when I go to stop recording. Totally lame, yes.

The indentation does go to the event file. The basic code from the video looked like this:

Code:
if $from == 'LEFT'
    player_at start left
endif

if $from == 'RIGHT'
    player_at start right
endif


The two player-sized event boxes on the stupid tower level had the names of 'start left' and 'start right' of course. That demonstrates the conditional scripting support I added yesterday. I will always have a "from" variable, and I'll make it so that I can set other variables on the fly as well.

I also worked briefly on the event system to add support for ... episodic events, let's call them. An event like 'load somelevel.txt' only needs one frame to execute, but an event like 'fade out' needs more than one frame. So, when I come across a fade out event, I call the fade_out function. It returns True or False depending on whether the fade has finished or not. The event system won't continue to the next available event until the fade has completed.

Finally, I finally added a context menu for objects. Now you can copy objects, which gives a taste of a quick-select mode.

I promise next time I'll have something more exciting than clickclickclick in a video. =)
_________________
The end of the game, yes, is pretty much getting the weapon and killing off the population.
mashup games . com | Finally! - A Lode Runner Story
View user's profile Send private message Visit poster's website AIM Address
sonrisu
Moderator

Joined: 31 Aug 2005
Posts: 4977
Location: Silicon Valley!
PostPosted: Sat Jan 12, 2008 2:34 pm    Post subject: Reply with quote

The sound or commentary would really be nice. Are you sure you can't manually edit it in afterward?
_________________
loomsoft :]
View user's profile Send private message Visit poster's website
mikedoty
Developer

Joined: 18 Mar 2006
Posts: 1788

PostPosted: Sat Jan 12, 2008 3:30 pm    Post subject: Reply with quote

I looked into that for the first one, but after a while I just gave up. I'm sure there's a way, but I wasn't having success. I was finding command line ... commands that were like a paragraph long that I completely didn't understand. :P
_________________
The end of the game, yes, is pretty much getting the weapon and killing off the population.
mashup games . com | Finally! - A Lode Runner Story
View user's profile Send private message Visit poster's website AIM Address
mikedoty
Developer

Joined: 18 Mar 2006
Posts: 1788

PostPosted: Sun Jan 13, 2008 2:25 am    Post subject: Reply with quote

Python's main drawback is, of course, speed. I have been finding that putting a rather reasonable number of objects on a map results in unreasonable slowdown. (The collision checking is causing the slowdown.) I'm going to try to code the collision detection routine in C. (The C part should prove easy; extending it for use in Python... I couldn't manage that in the short time I played around with an example. I'm sure this will make py2exe'ing it a whole lot of fun.)

I put together a test case in C and in Python of this code:

Code:
for (i = 0; i < 50000; i += 1)
{
    for (j = 0; j < 50000; j += 1)
    {
         z = x * y;
    }
}


The C version takes around 10 seconds or so. The Python version just clocked in at 1294 seconds. Maybe I screwed something up, but it's a pretty simple code block. So, I have hope that extending the collision detection to C will take care of the performance problems.

Oh, I added something pretty cool to the game today (that I'll also have to optimize, heh). If I get these performance issues sorted out, I'll work on getting a small walkaround demo put together for everyone to try out.
_________________
The end of the game, yes, is pretty much getting the weapon and killing off the population.
mashup games . com | Finally! - A Lode Runner Story
View user's profile Send private message Visit poster's website AIM Address
Reply to topic GDR Forum Index -> Game Developer's Refuge -> Development Log - ASCII Game [Demo 2 out] Page 1, 2, 3, 4, 5  Next

Use this link to get a Sign-On Bonus when you get started!

All trademarks and copyrights on this page are owned by their respective owners. All comments owned by their respective posters.
phpBB code © 2001, 2005 phpBB Group. Other message board code © Kevin Reems.