Bay 12 Games Forum

Please login or register.

Login with username, password and session length
Advanced search  
Pages: 1 ... 3 4 [5] 6 7 ... 29

Author Topic: My C++ Projects - Tower of Azari v0.31 - "I'm not dead yet."  (Read 52016 times)

Flaming Dorf

  • Bay Watcher
  • Oh No Indian!
    • View Profile
Re: Dwarf Caretaker v1.3, Sudoku Solver v1.0, Tower of Azari v0.20 +more!
« Reply #60 on: October 16, 2009, 06:28:35 pm »

Good work! Its going a lot more smoothly for me now, I didn't have to do anything special to run it.

Not to be totally off-topic, but this seemed like the place to ask: arrays of strings are crashing my game, but I'm not sure why. Whenever the game is told to assign text to one of the strings, it just quits. Do you guys know anything about this?

EDIT: Nevermind, problem solved. My computer just isn't powerful enough to store as many strings as I wanted it to. :(
« Last Edit: October 17, 2009, 12:16:30 am by Flaming Dorf »
Logged
[PERMITTED_JOINT:100] (It's a maximum number per day. This is the elven setting)

timmeh

  • Bay Watcher
    • View Profile
    • My Portfolio
Re: Dwarf Caretaker v1.3, Sudoku Solver v1.0, Tower of Azari v0.20 +more!
« Reply #61 on: October 17, 2009, 12:56:14 pm »

Okay, I've finally got the saving/loading working fully (So far as I can tell).  I wasn't adding the longer logs to the actual logs correctly.  They were getting loaded into the game, but not into the vector.  There may have been a couple other things, but that's what I can remember ATM...

Also, you can press 't' now to test the hunger/energy bars and the sight-lines.  I'm thinking the next thing I'll work on, as soon as I've finished my chores, is FOV, probably like this, cause that's the only one I've been able to really wrap my head around so far.

Updated the first post with the link.
Logged
On the Wall is a Masterfully engraved carving of Urist McHardcastle and Goblins. Urist McHardcastle is surrounded by the Goblins. The Golbins are stamping on Urist McHardcastle. Urist McHardcaste is laughing at the Goblins. The carving related to the prolonged and bloody death of Urist McHardcastle in the Fall of 1659, the Winter of 1659, and the Spring of 1660. On the engraving is an image of Cheese.

Outcast Orange

  • Bay Watcher
  • [SOMETIMES_SQUID]
    • View Profile
    • The Outcast Orange
Re: Dwarf Caretaker v1.3, Sudoku Solver v1.0, Tower of Azari v0.21 +more!
« Reply #62 on: October 17, 2009, 03:01:57 pm »

I've tried your game out. (finally)
It doesn't seem to crash anymore.

I spend ten minutes trying to get to the next level before I realized that I couldn't.
Still, you've got something solid now.

Keep up the good work!
Logged
[7:53:55 PM] Armok, why did you demand that I don't eat you?
[7:54:34 PM] [Armok]: woooooo

Burried Houses - Platform Explorer Demo H - Cloud Scream

timmeh

  • Bay Watcher
    • View Profile
    • My Portfolio
Re: Dwarf Caretaker v1.3, Sudoku Solver v1.0, Tower of Azari v0.21 +more!
« Reply #63 on: October 18, 2009, 04:04:20 pm »

Yeah, sorry about that.  I've started working on dungeon generation, to take a break from trying to figure out field of view and a simpler way to handle path finding (I could use A-star, but when I already know there's an unobstructed straight-line path between the monster and the player, why bother?)...

Anyways, I think dungeon generation is mostly working, but I can't get it to actually cut out the rooms, so I can't be sure.  I'm going to take a break and see if, like usual, I can figure it out by not trying so hard for a little while.  Worst possible outcome, I don't and I can come back to it with a clear head :P

What I've got so far, should anyone care to look...
Code Snippit

How it's called:
Game.current_map = make_dungeon(64, 23, 3);

"map" is the same data structure I've been using, where an array of integers (tile[][]) represents what tile is in that position.  (1 is a floor, 2 is a wall)  "room" is a very simple data structure that simply holds the coordinates of the top-left and bottom-right corners of a room.

If someone figures it out, great!  If not, I should get back to it later (probably after dinner, it's 5PM here), and we'll see when I can get it.

[EDIT]:  Still working on it.  I'll be updating the code snippet as I go (I love that website now...).  I've changed it to make sure the coordinates are correct (x1,y1 is the top-left, x2,y2 is the bottom-right) and figured out that the problem is somehow related to the width and height never being above 10 for some reason...  (I stuck "if(true)" in place of the width check, and it locked up on me.  So while there may be further issues with it, my first problem is going to be figuring out why width and height aren't being set as I expected...)

[EDIT 2]:  Well, I feel stupid... I had the structure set up wrong, so while I thought I was passing it (x1,y1, x2,y2) I was in fact passing it (x1,x2, y1,y2), notice the order difference?  Yeah, zero minus zero is not more than ten... doesn't work well... at least is wasn't division this time.  Unfortunately, as expected, there are new problems:



This is obviously not quite what I'm going for...

[EDIT 3]:  Well, this is a bit better I guess:



I'm not too worried about connecting the rooms yet, I'd rather try to get them all cut out correctly first... anyways, the issue was, yet again, partially my passing things in the wrong order.  I've also made a few more changes that should be making it work a bit better...

[EDIT 4]:  Better still!



Something is still wrong with the width/height checking though, I'll look into it some more later... it's 9PM here, so I'm going to start winding down now, I think the family is down-stairs watching a movie anyways.  I'll see if I can figure it out tomorrow...
« Last Edit: October 18, 2009, 07:58:37 pm by timmeh »
Logged
On the Wall is a Masterfully engraved carving of Urist McHardcastle and Goblins. Urist McHardcastle is surrounded by the Goblins. The Golbins are stamping on Urist McHardcastle. Urist McHardcaste is laughing at the Goblins. The carving related to the prolonged and bloody death of Urist McHardcastle in the Fall of 1659, the Winter of 1659, and the Spring of 1660. On the engraving is an image of Cheese.

timmeh

  • Bay Watcher
    • View Profile
    • My Portfolio
Re: Dwarf Caretaker v1.3, Sudoku Solver v1.0, Tower of Azari v0.21 +more!
« Reply #64 on: October 19, 2009, 04:41:46 pm »

Almost there!



Just about got it, problem is, they aren't connected, it only generates stuff like this some times, and that big room in the bottom right could definitely be split again... heck, several of the rooms are big enough to split again...

Here's the most recent code...
Logged
On the Wall is a Masterfully engraved carving of Urist McHardcastle and Goblins. Urist McHardcastle is surrounded by the Goblins. The Golbins are stamping on Urist McHardcastle. Urist McHardcaste is laughing at the Goblins. The carving related to the prolonged and bloody death of Urist McHardcastle in the Fall of 1659, the Winter of 1659, and the Spring of 1660. On the engraving is an image of Cheese.

Outcast Orange

  • Bay Watcher
  • [SOMETIMES_SQUID]
    • View Profile
    • The Outcast Orange
Re: Dwarf Caretaker v1.3, Sudoku Solver v1.0, Tower of Azari v0.21 +more!
« Reply #65 on: October 19, 2009, 11:00:29 pm »

I could try my hand at writing something like that,
but it would be nearly impossible to edit your code into something better,
as I have a somewhat barbaric technique of programming,
and have trouble contemplating what other people's code is doing.

I will definitely have something like this in my game at some point though.
And I very much hope you don't feel "1-upped", or maybe your code will be better/more specialized.
Logged
[7:53:55 PM] Armok, why did you demand that I don't eat you?
[7:54:34 PM] [Armok]: woooooo

Burried Houses - Platform Explorer Demo H - Cloud Scream

timmeh

  • Bay Watcher
    • View Profile
    • My Portfolio
Re: Dwarf Caretaker v1.3, Sudoku Solver v1.0, Tower of Azari v0.21 +more!
« Reply #66 on: October 20, 2009, 02:38:54 pm »

Well, more thanks to Alexhans, who has yet again helped me out of the little ditch I programmed myself into... :P

So close... just need to get the connections between rooms down...

Once I've got the rooms connected (my project for this afternoon), adding stairs, positioning the player and placing monsters should be pretty easy, which means multiple floors will likely make the next version :P

Current Code
Logged
On the Wall is a Masterfully engraved carving of Urist McHardcastle and Goblins. Urist McHardcastle is surrounded by the Goblins. The Golbins are stamping on Urist McHardcastle. Urist McHardcaste is laughing at the Goblins. The carving related to the prolonged and bloody death of Urist McHardcastle in the Fall of 1659, the Winter of 1659, and the Spring of 1660. On the engraving is an image of Cheese.

timmeh

  • Bay Watcher
    • View Profile
    • My Portfolio
Re: Dwarf Caretaker v1.3, Sudoku Solver v1.0, Tower of Azari v0.21 +more!
« Reply #67 on: October 20, 2009, 04:19:26 pm »

Multiple floors are in, the rooms are connected, monsters are spawned, stairs are added and the player is positioned correctly.  There seems to be a weird bug that makes it not create doors some times and the rooms are very boring, but it functions.  I'm thinking my next goal may be to change some of the rooms into tunnels, and fix the door thing, but first I need to figure out how I screwed up the distance function, cause the monsters are attacking even when I can't see them sometimes...



Which reminds me, FOV may not be in yet, but you can't see monsters through walls.  Hopefully I can get FOV figured out once I get the current bugs squished, as knowing where the exit is without having to look kinda kills part of the fun...
« Last Edit: October 20, 2009, 04:23:02 pm by timmeh »
Logged
On the Wall is a Masterfully engraved carving of Urist McHardcastle and Goblins. Urist McHardcastle is surrounded by the Goblins. The Golbins are stamping on Urist McHardcastle. Urist McHardcaste is laughing at the Goblins. The carving related to the prolonged and bloody death of Urist McHardcastle in the Fall of 1659, the Winter of 1659, and the Spring of 1660. On the engraving is an image of Cheese.

timmeh

  • Bay Watcher
    • View Profile
    • My Portfolio
Re: Dwarf Caretaker v1.3, Sudoku Solver v1.0, Tower of Azari v0.21 +more!
« Reply #68 on: October 21, 2009, 07:17:39 pm »

I decided to make one more change before releasing this version, and managed to completely screw things up with it... I wanted to allow the rooms to shrink, and not take up their whole area.  Problem is,  just plopping doors down along the walls to connect rooms doesn't work any more...

So, I've been trying to figure out how to set up hallways... I'll try and keep everyone updated, but this has got me stumped for the time being...  the code has changed a lot, but it's still available for those who want a look...

[EDIT]:  I haven't updated the paste-bin code, but I've reverted back to just having full rooms without hallways for the time being.  Once I figure out why it isn't spawning enemies after the first two floors I'll upload it.
« Last Edit: October 21, 2009, 08:09:45 pm by timmeh »
Logged
On the Wall is a Masterfully engraved carving of Urist McHardcastle and Goblins. Urist McHardcastle is surrounded by the Goblins. The Golbins are stamping on Urist McHardcastle. Urist McHardcaste is laughing at the Goblins. The carving related to the prolonged and bloody death of Urist McHardcastle in the Fall of 1659, the Winter of 1659, and the Spring of 1660. On the engraving is an image of Cheese.

timmeh

  • Bay Watcher
    • View Profile
    • My Portfolio
My C++ Game Projects - Tower of Azari v0.23 released 10/21/09!
« Reply #69 on: October 21, 2009, 09:11:17 pm »

Tower of Azari, Version 0.23 Release!

Internal Changes
  • Fixed a naming problem with door states (open/closed), had them backwards somewhere...
  • Added an enum for the tiles.  Still need to make it global somehow...
  • Removed test function.
  • Removed the "turns" and "time" variables in place of the new ones in the _game structure.
  • Changed hunger and energy scales from 0-100 to 0-1,000.

Visual Changes
  • Added the "Press enter to continue" prompt to the stat adjusting part of character creation.
  • Fixed a small puctuation error in one of the action log messages.
  • Redesigned the starting map to look more like the bottom floor of a building.
  • Status screen updated to display the player's current position, total steps taken and time passed.

Gameplay Changes
  • Map generator is in!
  • Traditional experience levels have been replaced with an EXP point-buy system.  More on this later.
  • Enemies will chase you, if they can see you.
  • Killing enemies now nets you EXP.  (Their max HP+the average of their five primary stats)
  • Stairs going up now work, I'm considering saving floors for revisiting in the future, but for the time being, you can only go up.
  • Every five floors you are given the option to rest and spend experience points for stat increases.  In the future, you will also be able to buy/sell items as well.
  • Hunger and energy now slowly decrease over time.  There is no effect when they hit 0 yet, but they do decrease.

The download link is in the original post.
« Last Edit: October 21, 2009, 09:15:03 pm by timmeh »
Logged
On the Wall is a Masterfully engraved carving of Urist McHardcastle and Goblins. Urist McHardcastle is surrounded by the Goblins. The Golbins are stamping on Urist McHardcastle. Urist McHardcaste is laughing at the Goblins. The carving related to the prolonged and bloody death of Urist McHardcastle in the Fall of 1659, the Winter of 1659, and the Spring of 1660. On the engraving is an image of Cheese.

Outcast Orange

  • Bay Watcher
  • [SOMETIMES_SQUID]
    • View Profile
    • The Outcast Orange
Re: My C++ Game Projects - Tower of Azari v0.23 released 10/21/09!
« Reply #70 on: October 21, 2009, 10:52:58 pm »

Sounds awesome!
You should work more on procedural hallways.
That sounds like it would be awesome to program.

I'm sorry, I have an unnatural lust for problem solving.
I'll have to try it soon.

P.S. : Why aren't you on MSN when I am?
Logged
[7:53:55 PM] Armok, why did you demand that I don't eat you?
[7:54:34 PM] [Armok]: woooooo

Burried Houses - Platform Explorer Demo H - Cloud Scream

eerr

  • Bay Watcher
    • View Profile
Re: My C++ Game Projects - Tower of Azari v0.23 released 10/21/09!
« Reply #71 on: October 22, 2009, 12:54:34 am »

I'm totally going to "borrow" whatever you use to detect keypresses.
Logged

timmeh

  • Bay Watcher
    • View Profile
    • My Portfolio
Re: My C++ Game Projects - Tower of Azari v0.23 released 10/21/09!
« Reply #72 on: October 22, 2009, 07:52:16 am »

@Outcase Orange - Do I have your MSN?  I think I've only got Alexhan's...  Anyways, I tried shrinking the rooms and adding hallways, but I'm going to have to find a way for it to know which rooms to connect first.  In the BSP article I posted earlier they are generated in tiers and keep track of their sister and parent "leaves", so I may have to figure out a way to do that...

@eerr - I use the PDCurses library.  I actually included some (very) basic setup instructions for compiling ToA in the readme, but there's a very good tutorial here, assuming you're using Code::Blocks.  I'm sure there are other tutorials elsewhere, I just haven't seen them.

As far as learning to use PDCurses, I never really did find any tutorials, but this page was very helpful in getting started.  Keep in mind though, that's for "NCURSES", so there may be some small differences.  There's a list of all the PDCurses functions and such here.

Oh, and before I forget, PDCurses itself can be found here.  If you need any help with it let me know.
Logged
On the Wall is a Masterfully engraved carving of Urist McHardcastle and Goblins. Urist McHardcastle is surrounded by the Goblins. The Golbins are stamping on Urist McHardcastle. Urist McHardcaste is laughing at the Goblins. The carving related to the prolonged and bloody death of Urist McHardcastle in the Fall of 1659, the Winter of 1659, and the Spring of 1660. On the engraving is an image of Cheese.

Outcast Orange

  • Bay Watcher
  • [SOMETIMES_SQUID]
    • View Profile
    • The Outcast Orange
Re: My C++ Game Projects - Tower of Azari v0.23 released 10/21/09!
« Reply #73 on: October 22, 2009, 11:28:26 am »

Oh sorry, I have you and alexhans mixed up in my head.

I really liked curses for the brief period of time I was using it.
Logged
[7:53:55 PM] Armok, why did you demand that I don't eat you?
[7:54:34 PM] [Armok]: woooooo

Burried Houses - Platform Explorer Demo H - Cloud Scream

timmeh

  • Bay Watcher
    • View Profile
    • My Portfolio
Re: My C++ Game Projects - Tower of Azari v0.23 released 10/21/09!
« Reply #74 on: October 22, 2009, 05:57:34 pm »

That's fine, if you don't mind, I'd really like to get your MSN some time, if you could PM it to me.

On another note, I recently noticed that, if I save a game it will load fine from inside the game, and if I back out with the 'q' key I can load from the menu, but if I try to load after quiting completely (close and re-open the program) it doesn't load the name or the logs...  This may have something to do with my half-implemented items/inventory, so if someone could check if it's a problem in v0.23 for me I'd really appreciate it.

Another mini-bug I've noticed, that doesn't merit a re-upload, is that I've accidentally mislabeled the v0.23 upload within the source code as being version 0.22... aside from the credits screen and the commenting at one point in the source though you'd never know.
Logged
On the Wall is a Masterfully engraved carving of Urist McHardcastle and Goblins. Urist McHardcastle is surrounded by the Goblins. The Golbins are stamping on Urist McHardcastle. Urist McHardcaste is laughing at the Goblins. The carving related to the prolonged and bloody death of Urist McHardcastle in the Fall of 1659, the Winter of 1659, and the Spring of 1660. On the engraving is an image of Cheese.
Pages: 1 ... 3 4 [5] 6 7 ... 29