Check out our blog!
Forumwarz is the first "Massively Single-Player" online RPG completely built around Internet culture.

You are currently looking at Flamebate, our community forums. Players can discuss the game here, strategize, and role play as their characters.

You need to be logged in to post and to see the uncensored versions of these forums.

Log in or Learn about Forumwarz

Civil Discussion
Switch to Role-Playing Civil Discussion
Bug - 3 I'm developing a roguelike

BirdofPrey

Avatar: 2037 Sun May 10 02:46:48 -0400 2009
10

[Team Shortbus]

Level 10 Troll

I lick her up afterwards (After her great times session too! Yum!)

The cool detailed post will have to wait because i’m dead tired.

Made lots of progress today!

– When an item is added to an inventory it now gets auto-sorted into categories.

– I consolidated the eventhandler clbum and graphics clbum into one “UserInterface” clbum. I probably shouldn’t really call this progress though, because the way things worked out I didn’t actually need to do that, and now it’s a little bit cluttered. Makes no difference implementation wise, but I may change back just for organization purposes.

– Wrote a metric ****ton of code, and now I have menus! Basic item menus are working – they display fine and are successfully returning the user’s choice. This is a big victory.

The menus are still rather threadbare – things I still need to implement include item stacking, as I mentioned before, and scrolling up and down for long lists.

So far the only actions I’ve coded in are walking, quitting, taking, and showing your inventory, but the list is growing every day. Tomorrow I plan to take care of the dropping action, and if I have the stamina maybe some filtering and scrolling commands for menus. After that I think it’ll finally be time to give the player some stats, and maybe start work on how creatures other than the player will act/react.

tldr – menus work now, and i’ll make a cool detailed post soonish.

BirdofPrey

Avatar: 2037 Sun May 10 02:46:48 -0400 2009
10

[Team Shortbus]

Level 10 Troll

I lick her up afterwards (After her great times session too! Yum!)

FAIL

Avatar: 36735 2015-06-13 23:04:37 -0400
6

[Full of SbumSS]

Level 25 Re-Re

Head of the Ministry of Man bumes

This is pretty interesting to me, I didn’t realize how much went into simple commands and action/reaction things.

I’ve never played a roguelike so I don’t know what the hell is going on in those screens, but it looks a lot more like one of those kind of games now nice job haha

BirdofPrey

Avatar: 2037 Sun May 10 02:46:48 -0400 2009
10

[Team Shortbus]

Level 10 Troll

I lick her up afterwards (After her great times session too! Yum!)

First a quick update:

– Fixed some errant bugs in the menu system that was making **** crash – also implemented dropping **** and that’s working fine.

– Dealt with some potential memory leaks… in a program as small and simple as this, a few memory leaks wouldn’t really be an issue, but I feel better having taken care of them anyway.

– I added a clbum for special tile objects, such as doors, traps, stairways etc. So far only doors are implemented.

– To complement my new doors, I made the opening action! This is the first action I made that can be generated implicitly – that is to say, just walking into a door can generate an opening action. As a result, I needed to make a quick function to get confirmation from a player (like a ‘type y/n’ ) kind of thing. That’s working well!

Things on my agenda:

– My current menu system is ok, but I want to add a lot more detail to it. It’s tedious to stand on a big stack of items and have to pick up each item one by one. When I have the motivation I’m going to make some big changes to allow you to choose multiple items from a menu at once.

– I need to start thinking about adding some creatures other than the player to the mix. That’s going to be a very large task, and I’m kind of procrastinating on that.

– Another big, difficult part that I’ve been procrastinating like mad is the whole Field of Vision problem. I’m very taken with the method described here. I’m not convinced it’s my best option, but I’m thinking of trying it out soon.

Anyway, I promised you guys some broader details about how things are working/going to work, but I’m going to spread it out over several posts. Here’s a morsel:

Modeling the world

Luckily for me, object-oriented programming makes this kind of thing very easy to pull off coherently. A tile is represented by an instance of a Tile clbum, a creature is represented by an instance of a Creature clbum, etc. etc. Once I defined what all of these objects are, it was easy to make a kind of hierarchy – for example, a Tile has all of the tile’s relevant data (is it pbumable, what it’s made of), but it also contains pointers for anything that could potentially be on that tile, such as a creature, special object or list of items. those things in turn have their own data and pointers. If you needed to, you could travel down the line someway like this:

dungeon -> map -> tile -> creature -> Inventory -> Item -> Item name.

Basically any information in the entire active area is accessible in this manner, and you can start from anywhere in the list to work your way downwards. In some cases, you can even go backwards up the line from some things.

Anyway, I’m ****ing tired. Dunno if that was what you guys were looking for or not, but in later posts i’ll talk more in depth about other things. ‘night

BirdofPrey edited this message on 07/15/2008 3:01AM

BirdofPrey

Avatar: 2037 Sun May 10 02:46:48 -0400 2009
10

[Team Shortbus]

Level 10 Troll

I lick her up afterwards (After her great times session too! Yum!)

here’s something that might interest you guys:

I’m considering very strongly now using external info files to hold the data for skills/special areas/items, etc.

On top of that, I’m thinking of how I might implement some kind of scripting feature – pseudocode in the info files that could be interpreted by the main engine.

If I managed to pull something like that off successfully, it would mean that i could reveal how the scripting system works, and anyone (i.e. you guys) could use it to write your own items, monsters, and scenarios. You could send them to me for scrapping/editing/balancing and I could incorporate it into the main game. Make it more of a community effort. We’ll see how it works out.

BirdofPrey

Avatar: 2037 Sun May 10 02:46:48 -0400 2009
10

[Team Shortbus]

Level 10 Troll

I lick her up afterwards (After her great times session too! Yum!)

So I spent hours writing a mbumive block of code for Field of View, and of course it turned out to be a monstrous unreadable buggy piece of ****. View the trainwreck here.

So I’m basically at the point right now where I plan to completely scrap it and remake it, and do it right this time.

Also, I’m sick of dynamically allocating everything, and I’ve decided to switch my data structures over to STL containers. I honestly have no idea why I didn’t do it before. I’ll probably make some intermediate templated clbumes to make the interface easier.

So my current plan is to write the intermediate clbumes, switch over to STL (which will basically entail gutting almost all of my inventory handling code), and then remake the Field of View so it’s short, readable and working.

Also you fabulous persons should post in my thread more.

Sancdar

Avatar: Sancdar's Avatar
35

[Team Shortbus]

Level 50 Camwhore

LCC club

This thread is relevant to my interests!

Also damn, that’s a pretty large function. I bet it was a pain in the bum to try to debug.

BirdofPrey

Avatar: 2037 Sun May 10 02:46:48 -0400 2009
10

[Team Shortbus]

Level 10 Troll

I lick her up afterwards (After her great times session too! Yum!)

Sancdar Posted:

This thread is relevant to my interests!

Also damn, that’s a pretty large function. I bet it was a pain in the bum to try to debug.

yeah the whole thing was a disaster. When I remake it I’m going to break it up better.

BirdofPrey

Avatar: 2037 Sun May 10 02:46:48 -0400 2009
10

[Team Shortbus]

Level 10 Troll

I lick her up afterwards (After her great times session too! Yum!)

Epic victory! My revised FoV code works perfectly.

Here’s the story: After trashing my previous one, I wasn’t quite sure how to start so I did some internet detective work and found some example code in Java by the guy who came up with the algorithm himself. I painstakingly ported it over to c++ with my system, and it was still ****ing up horrendously!

After going through comparing the 2 versions line by line like 3 times and not finding anything wrong, I did some more internet sleuthing and found out that it was actually a known issue that the example code he put up didn’t give the right results in a number of situations.

Welp, if you want to do something right, you’ve got to do it yourself. I made several key changes, making some of it much simpler than the original, moving stuff around, adding some stuff, and the end product seems to work completely!

Here is the revised code.

And some screenies:

http://i14.photobucket.com/albums/a301/birdofprey161/RogueLike%20Creation/FoV1.png

http://i14.photobucket.com/albums/a301/birdofprey161/RogueLike%20Creation/FoV2.png

The above screenshots are actually a little misleading. They make it seem like the game is remembering visiting tiles and displaying them as well. What’s actually happening is the screen is only updating the visible tiles without clearing the screen first. If you do something that clears the screen, for example open a menu, when you return to the map it’ll only display the tiles that are currently visible to you. Adding the ability to remember previously visited tiles will be very easy though.

To-do list (in order of when I plan to do it):

– Add aforementioned ability to remember seen tiles. I think I may only have it remember tiles if there is something notable there like a wall or item. Either that or make the dots on remembered tiles dimmer than those on visible tiles. It always bothers me in roguelikes that there’s no way to differentiate between remembered and currently visible empty tiles.

– My program is quickly leaving the realm of a casual plaything and turning into a hardcore project. It’s time I went through the code that’s already there and organize and encapsulate it better. It’ll be much easier to do what’s necessary now rather than have to do it much later when there’s a hundred times as many things to edit. This’ll probably involve some optimization, making a more organized clbum hierarchy, and start planning things in terms of my ultimate goal, which is a highly flexible scripting language that can be interpreted by the in-game parser.

– Related to above, but even before I start any real scripting features, I should at least start working on getting any data (there isn’t any yet Log in to see images!

Morro the As-
sless

Avatar: Morro the Assless's Avatar

[Gunther and the Su-
nshine Girls fancl-
ub
]

Level 10 Troll

The Biggest and Greatest Bodyguard on the Interwebz

Bird, you have my respect, and i will be looking forward to playing it (an avid roguelike gamer, and one time contributor to the animeband game)

BirdofPrey

Avatar: 2037 Sun May 10 02:46:48 -0400 2009
10

[Team Shortbus]

Level 10 Troll

I lick her up afterwards (After her great times session too! Yum!)

Morro the bumless Posted:

Bird, you have my respect, and i will be looking forward to playing it (an avid roguelike gamer, and one time contributor to the animeband game)

cool man! if you’re interested i can get you in on beta testing whenever that happens far into the future. also don’t forget that if this scripting idea works out, you could actually have a part in creating the content.

ANGRY HOBO

Avatar: 49150 Tue Aug 11 01:43:48 -0400 2009
1

Level 28 Emo Kid

lmbo i gave this account and now its full of people :D bye all this game is ****....................

Sancdar

Avatar: Sancdar's Avatar
35

[Team Shortbus]

Level 50 Camwhore

LCC club

BirdofPrey Posted:

It always bothers me in roguelikes that there’s no way to differentiate between remembered and currently visible empty tiles.

DoomRL

Angband

What’s your game going to be named?

BirdofPrey

Avatar: 2037 Sun May 10 02:46:48 -0400 2009
10

[Team Shortbus]

Level 10 Troll

I lick her up afterwards (After her great times session too! Yum!)

Sancdar Posted:

DoomRL

Angband

What’s your game going to be named?

never played either of those. And I have no clue what to call mine. I’ll decide on that later.

Dead-Inside

Avatar: Crying Statue

Level 4 Emo Kid

“Emotionally Stable”

If you want to check out a really good rougelike (That’s also a RTS, actually foremost an RTS) you should go to www.bay12games.com/dwarves . It’s good stuff.

http://mayday.w.staszic.waw.pl/df.htm Graphical tiles for said game, even better stuff.

Anyway, good luck with the rougelike, looks like you’re getting it together.

BirdofPrey

Avatar: 2037 Sun May 10 02:46:48 -0400 2009
10

[Team Shortbus]

Level 10 Troll

I lick her up afterwards (After her great times session too! Yum!)

Dead-Inside Posted:

If you want to check out a really good rougelike (That’s also a RTS, actually foremost an RTS) you should go to www.bay12games.com/dwarves . It’s good stuff.

http://mayday.w.staszic.waw.pl/df.htm Graphical tiles for said game, even better stuff.

Anyway, good luck with the rougelike, looks like you’re getting it together.

I Log in to see images!

BirdofPrey

Avatar: 2037 Sun May 10 02:46:48 -0400 2009
10

[Team Shortbus]

Level 10 Troll

I lick her up afterwards (After her great times session too! Yum!)

I never got around to that dwarf fortress (sorry veer!) but here’s some more roguelike ****e!

While starting on Step 1 of my last ‘to-do list’ I ended up getting pretty side-tracked. Since the last update, I’ve re-done my item-handling and inventory code to use STL linked-lists instead of my own linked list functions, though there’s no obvious change in its behavior.

As a complement to the inventory revamp, I tore down my old threadbare Menu system and completely redid it from scratch. It has a ****load more functionality. The first one didn’t even allow scrolling, and only let you choose one item at a time. My new menus are hardcore: They allow multi-page scrolling for long lists, and when you create a menu you can specify whether or not it will allow multiple choices, and multiple choice menus will allow you to select any number of options. That’ll be used for actions like picking up and dropping stuff.

Also, beforehand, every time a menu was made it would bumign keyhandles from scratch like in ADOM, but now when items are bumigned a keyhandle that key stays with it unless it moves or you adjust it manually. This is more similar to a nethack style inventory, and is convenient because if you’re using an item frequently you can simply memorize its keyhandle and use it quickly instead of having to find it in the menu every time. On the other hand, this may necessitate an inventory limit of around 50, but that could be part of the resource-management part of the game.

If all that **** bored you to tears, maybe you’ll find this more interesting. I’ve been planning out my scripting system (haven’t written any of it yet). If things work out, the only things in the game that won’t be able to be customized and scripted will be creature’s actions. (you won’t be able to make a ‘enjoy’ action or whatever, though i suppose you could make it into a skill/spell). It may also be difficult to script your own item clbumes such as potions, scrolls, etc. That might be impossible too. Otherwise everything else should be fair game.

For a demonstration, here’s what Nethack’s “loadstone” would look like as defined by the external file. A loadstone is a rock that is extremely heavy that automatically becomes cursed when it is picked up, and won’t let you drop it as long as it is cursed. The syntax will not be exactly this, but it’ll be close enough:

ROCK <loadstone>{ #First, the 'clbum' of item, followed by the item's unique identifier

#basic item settings - these should be self-explanatory
NAME    "loadstone"
WEIGHT  1000
VALUE   10
COLOR   GRAY

#Flags & special values would go here - These would include things like flammable, rustable, lightsource, etc.
#I actually can't think of any that would apply here so I'll leave it blank

#And here is the script section:

#First, we need to make it autocurse when it picks up. When an item is picked up a 'Take' trigger is
#generated for the item. The trigger checks for a hook in the item code, and if it finds one it executes
#the script it finds there. Here is the 'taken' hook.
Take{
    Execute;  #This command will have the action continue normally until just before reporting it
    set item.cursestatus CURSED;  #curses the item
    Report "As you pick up the rock it latches onto you!"; #report displays the text and generally halts the action
}

#And now the drop script, to specify that a cursed loadstone cannot be dropped.
Drop{
    if (item.cursestatus = CURSED){
        #We don't write 'Execute' here because we don't want the dropping action to go through.
        Report "You can't seem to drop this damn thing!"; #So we just report it and the action fails.
    }
    #If the item is not cursed, no report command is found so the action continues and finishes normally
}

}

So that’s pretty much it! This is a very simple example, and some items and such with complicated rules could have dozens of lines of this fake code to define its behavior. Also the example is slightly incomplete because you’ll notice we didn’t account for which creature is picking up the stone. Obviously if a monster was picking up the rock we wouldn’t want to inform the player that the rock is latching on to him. That’ll all be possible though.

Sancdar

Avatar: Sancdar's Avatar
35

[Team Shortbus]

Level 50 Camwhore

LCC club

BirdofPrey Posted:

If things work out, the only things in the game that won’t be able to be customized and scripted will be creature’s actions. (you won’t be able to make a ‘enjoy’ action or whatever, though i suppose you could make it into a skill/spell).

I bumume you mean complex scripted behaviors like the fuccubi in nethack, and not like attack descriptors. Because I think you could totally make a enjoy monster.

DEMON <bum****er>{ #First, the 'clbum' of monster, followed by the monster's unique identifier

#basic monster settings - these should be self-explanatory
NAME    "bum****er"
HEY LOOK STATS

#Flags & special values would go here - These would include things like flammable, rustable, lightsource, etc.
ORGANIC
DISGUSTING
DEMONIC
HAS_male reproductive organ

#Attack descriptors!
ATTACK_PRESENT_TENSE rapes    #The bum****er rapes you for 59 damage!
ATTACK_PAST_TENSE raped       #The bum****er barely raped you. You take 22 damage.
WEAPON_NAME giant barbed male reproductive organ #You narrowly dodge the bum****er's giant barbed male reproductive organ.
WEAPON_TYPE piercing
WEAPON_ATTACKS thrusts        #The bum****er thrusts its giant barbed male reproductive organ at you.
WEAPON_ATTACKING thrusting    #The bum****er's thrusting giant barbed male reproductive organ penetrates the schoolgirl.

BirdofPrey

Avatar: 2037 Sun May 10 02:46:48 -0400 2009
10

[Team Shortbus]

Level 10 Troll

I lick her up afterwards (After her great times session too! Yum!)

Sancdar Posted:

I bumume you mean complex scripted behaviors like the fuccubi in nethack, and not like attack descriptors. Because I think you could totally make a enjoy monster.

[/code]

Actually, I imagine you could write something like the foocubi (You would just need to use the ‘Attack’ hook in the monster script). What I meant was you can’t make up some new action, like “enjoy”, and map it to some key saying ‘okay now every time the player press control-r it’ll do the enjoy action. The reason is that things like checking for hooks and setting the parameters for actions are going to be hard-coded, and letting anyone make up arbitrary actions would end up interfering with the way scripts interact with each-other.

There’s nothing stopping you though from making a ‘enjoy’ technique though, or raping monster attack, so it really isn’t such an important limitation. Log in to see images!

edit – Ah, I see there was some confusion when I said “creature’s actions”. I worded it that way because I’m considering all living entities to be creatures, even the player. You could do exactly what you said and make a special ‘rapey’ attack for a monster, but the triggers that’ll set off will still be the standard Attack trigger. I guess it would be more accurate to say that you will be able to script anything except for your own custom triggers and hooks.

edit – That’s actually also why it be difficult to script your own base item clbumes – since it’ll be hard coded as to which actions can apply to which items. I could conceivably get around this with a series of flags such as ‘drinkable’ ‘portable’ ‘wearable’ etc. That’ll remain to be seen.

BirdofPrey edited this message on 07/30/2008 4:40PM

Veer

Avatar: 2059 Thu Nov 13 08:18:14 -0500 2008
6

[Team Shortbus]

Level 32 Troll

my only complaint is that you people are happy

this looks awesome

i promise to create a “little girl” enemy

Internet Delay Chat
Have fun playing!
To chat with other players, you must Join Forumwarz or Log In now!