Bay 12 Games Forum

Please login or register.

Login with username, password and session length
Advanced search  
Pages: 1 ... 7 8 [9] 10 11 ... 29

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

Alexhans

  • Bay Watcher
  • This is toodamn shortto write something meaningful
    • View Profile
    • Osteopatia y Neurotonia
Re: My C++ Game Projects - Tower of Azari v0.27 released 11/05/09!
« Reply #120 on: November 06, 2009, 07:51:59 am »

Bitwise operators are cool and fast but harder to read so you need to be clear about what you're doing.  An interesting test is to use Xor to encrypt a file.

Anyway... I have internet!!!  So I'll download the game at home and give it a good review. 

I took a pick at the enemies class header and cpp and you've done a great job converting it.  Welcome to OPP! :)

Anyway, remember to avoid magic numbers as much as you can...
for example:
   
Code: [Select]
int exp = maxhp + (stre+dext+perc+endu+inte)/5;  //Experience gain is the target's max hp + the average of their stats.You can't know if you will add more stats in the future (that will modify experience)... better to just add a constant with the value.
Logged
“Eight years was awesome and I was famous and I was powerful" - George W. Bush.

timmeh

  • Bay Watcher
    • View Profile
    • My Portfolio
Re: My C++ Game Projects - Tower of Azari v0.27 released 11/05/09!
« Reply #121 on: November 06, 2009, 08:26:40 am »

Thanks! 

That's a good point.  I may add a function to the enemy class that returns the average of their stats or something... maybe another for their total, cause that's used elsewhere... either way, thanks for the heads up!

I may or may not have time to tackle the bitwise stuff today, as I have a lot to do (school in the morning, community service volunteering (part of one of my school classes) in the early afternoon and another school related event tonight...).  We'll see though.  Once this is done I'll need to overhaul the item editor to allow easier setup for the multiple effects... although the editors have needed work for a while.  I plan on rewriting parts of them to make it easier to use overall, things like a text-display of the item types instead of setting it with a number, like the stats.
« Last Edit: November 06, 2009, 10:32:41 am 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.27 released 11/05/09!
« Reply #122 on: November 06, 2009, 10:55:30 am »

When you say magic numbers, do you mean the cases where you put in a named variable instead of a constant?
That is super useful when the functions get longer and more complex, in my opinion, otherwise you have to run through and turn every 5 into a 3 or some such.

I'll probably give it a test run too.
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

Alexhans

  • Bay Watcher
  • This is toodamn shortto write something meaningful
    • View Profile
    • Osteopatia y Neurotonia
Re: My C++ Game Projects - Tower of Azari v0.27 released 11/05/09!
« Reply #123 on: November 06, 2009, 11:08:07 am »

No... magic numbers mean when you write a literal number directly into your code instead of having a constant for it.  Then, if you need to change that you'll have to scan your entire code to find where it needs to be modified.

Quote
community service volunteering (part of one of my school classes)
Don't lie to us.  timmeh... what did you do?  Steal a car?  Sell drugs? :D

The editors are great anyway.  I've never made an editor... Always screwed with the files... :S

Logged
“Eight years was awesome and I was famous and I was powerful" - George W. Bush.

Killas[SiN]

  • Bay Watcher
  • [SiN]
    • View Profile
Re: My C++ Game Projects - Tower of Azari v0.27 released 11/05/09!
« Reply #124 on: November 06, 2009, 04:18:59 pm »

Mmmm this is awesome!

Oh yeah, a question about magic - is it going to be high magic or low?

High magic is like 'fireball' and 'magic missile'... You know, the more generic stuff.

I'm not really sure how to define low magic... but don't google it, comes up with all this stuff about witchcraft in real life...

But well, I guess  you could say... Is magic going to be everyday generic 'fireball'?
Logged
You should make Korean pros into game-ending, SPEED:0 megabeasts.
A Jaedong appears at your fort.
DF: gg
DF has left the game.

timmeh

  • Bay Watcher
    • View Profile
    • My Portfolio
Re: My C++ Game Projects - Tower of Azari v0.27 released 11/05/09!
« Reply #125 on: November 06, 2009, 10:50:53 pm »

@Outcast Orange - What Alex said :P

@Alexhans - :P  Trust me, if I'd stolen a car, you'd know about it :P  I'm one of those people who would have been all over the news.  I'm slow to start something, but once I have I have no intention of stopping until I am well and truly done.  That being said, I don't know that I'm capable of stealing a car anyways... the drug deal is a little more reasonable, although probably a little unsafe since the sheriff just moved in two doors down :P  Seriously though, it can hardly count as community service, since it was of more benefit to the class than to anyone else.  We raised money to sponsor someone for the group I'm in (legally considered homeschool, more like a private school though).

Thanks though, I like having the editors, although they still need some work...

@Killas - Well, it'll probably start out more like the generic 'fireball' and 'magic missile', but I'd really like to eventually get some more interesting effects.  Maybe end up with some combination of what DF sounds like it'll do and Oblivion, with a sort of "anything's possible with magic" style, and the ability to combine the effects from the spells you know to create your own.  Although that'd be a little trickier...


On an unrelated note, since I didn't have enough time to tackle the effect changes today, I converted the item struct into a class, which I'm hoping will make the change a little easier.

[EDIT]: Multiple effects are just about done, I just need to test them and then get some work done on the editors before I can release again.  I have the item editor allowing me to easily edit each object's effects, with a decent interface, so going back and fixing the types and stuff shouldn't be too hard.
« Last Edit: November 07, 2009, 05:10:17 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: My C++ Game Projects - Tower of Azari v0.28 released 11/07/09!
« Reply #126 on: November 07, 2009, 10:18:19 pm »

Version 0.28 Release!

Internal Changes
  • Added some constants to replace magic numbers in "item.h".
  • Added functions to retrieve the movement cost for the player and enemies.
  • Added constants for map width and height.
  • Items are a class instead of a struct.

Visual Changes
  • Updated the color for gold.

Gameplay Changes
  • Items can have multiple effects.

Editor Changes
  • The item.raw format has been changed to record multiple effects.
  • Item Editor updated to allow the editing of multiple effects.
  • The numbers displayed for slot and item type have been replaced with words.
  • The input for slots and item types have been seriously improved.
  • Added slot -1 (N/A) for non-usable items.

See the first post for the download.

As you may notice, I have an icon for the exe now.  I kinda need help in two ways with the icon.  The first, I'd like an icon I didn't download from a random "free icons" website, so anyone with some artistic talent, I'd really appreciate the help.

Second, I set the icon up with ResHack, and I'd much rather do it right (resource files?).  Where might I find information on how exactly to do that?
« Last Edit: November 07, 2009, 10:27:04 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.28 released 11/07/09!
« Reply #127 on: November 09, 2009, 11:09:56 am »

It looks great!
At least one of us is getting something interesting done.
Having an external editor has given me a very exciting new idea.
Timmeh inspires me further!

Keep adding to this thing, it's looking better every time.

Also, my eyes start crossing when I think about icon use, so no help here.
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.28 released 11/07/09!
« Reply #128 on: November 09, 2009, 01:09:03 pm »

It looks great!
At least one of us is getting something interesting done.
Having an external editor has given me a very exciting new idea.
Timmeh inspires me further!

Keep adding to this thing, it's looking better every time.

Also, my eyes start crossing when I think about icon use, so no help here.

Thanks!  I'm intrigued by your "exciting new idea"... please explain :)

Anyways, I managed to write a smallish bit of code this morning before school that'll lets the player pick a square within his field of vision.  It doesn't do anything with the square, but I personally prefer it that way, as I can use it in multiple places.  For example, I just now re-wrote the "look" code to let the player pick where to look, so now you can see what a monster is without attacking it, see how much money is on a square, etc.  Not particularly useful, but it'll be really helpful when I look at getting ranged weapons and/or magic in.  Which I'm planning to do now actually, I'm trying to figure out how I want each to work, then I'll probably start with ranged weapons, for the sake of simplicity.

I'm thinking it'll work like a normal melee weapon if you want it to (I've been replaying Assassin's Creed the last few days, and in the opening cut-scene he shoots one guard with a crossbow, and then stabs the next guy with one of the sides, which sorta got me thinking 'Why can't I use my bow for a club if I want?")  That being said, I'm thinking most ranged weapons will decrease strength, to make melee attacks less useful when you're using one.  Then I can set up a fire button that lets the play choose where to fire, then launches the ammo.  The only tricky part there is figuring out if I wan't an enemy between you and your target to be able to stop the arrow, cause the collision line may be a trick... you can't target a square you can't see, so I don't have to worry about the player aiming it somewhere a wall would get in the way, but still...

[EDIT]:  For the time being, the arrows will not be stopped by another enemy in their path, but they work.  I've got 3, hard-coded ammo types to use (arrows, bolts, and bullets.  I don't plan on having guns, but I wanted the option to be there for either that or slings).  To make a ranged weapon, you make a normal weapon, then choose an ammo type for it.  If you leave the ammo type at N/A it'll only work as a melee weapon, but if you change it then it will be capable of launching ammo of the type you selected. 

Ranged weapons use dexterity both for to-hit and damage when used as such (they act like normal weapons in melee combat).  The stat mods from the weapon work normally, but of the mods from the arrow, only strength and dexterity currently have any effect.  Strength mod of an arrow increases damage, and dexterity mod on an arrow increases accuracy.

I want to do some touch-up, update the editor, and make some default ranged weapons and then I'll let it loose for you guys to play with as you wish.

[EDIT2]:  The editors are done, and the ranged weapons are just about done.  Also, I figured out how to set up an icon.  It's really simple, now that I know.  I added a file called "resource.rc" to the project with just the line:
IDR_APP_ICON ICON "icon.ico"
No semi-colon or anything.  So long as the "icon.ico" file is in the project's "/bin" directory, it compiles with the new icon :)
« Last Edit: November 09, 2009, 08:55:33 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.28 released 11/07/09!
« Reply #129 on: November 10, 2009, 08:29:00 am »

You are getting all sorts of stuff done.

I'm not sure something like this has ever been done, but here goes.

What if my universe was not formed by a forced set of actions every time,
but instead there was a init file containing the list of "generators" to be applied.
Then you could have the generators in the raws, and they could have a tag for their attributes.
So you could not only pick what happened to form your universe, but you could mix and match features.
It doesn't sound like it would be all that hard to make each land formation tag dependent,
then write a default list to get the results in my current game.

Imagine being able to add your own geometry tags to things:

Template: New Plate 1
[Cylinder_Growth]
[Golden_Core]
[Subvine_Leaves]
[Material:Stone]
[Radius:8]
[HrzGrowth:100]

Not only that, but I could have
one for each material,
one for each NPC,
one for the player character,
one for each reaction,
and any other such things I wish.

Sounds good?
I'm certain I'll be free by Sunday.
Look forward to a push in this direction.



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.28 released 11/07/09!
« Reply #130 on: November 10, 2009, 09:17:19 am »

That sounds awesome!  It'd be a blast, just messing with the settings to see how it turned out (I.E. Floating vines with a core, a single, massive plate, etc.)....

I'd start by loading the materials you already have, just so you can get use to the file management.  I've been using this to load/edit ini files in my game.

Anyways, looking forward to it!  I have school in a few minutes, but I should be able to bring my laptop and get what I've got done packaged into some sort of release, so you guys can toy with the ranged weapons while I work on figuring out how I want to do magic (as far as code, I know pretty much how I want it to work).
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: My C++ Game Projects - Tower of Azari v0.29 released 11/10/09!
« Reply #131 on: November 10, 2009, 04:32:29 pm »

Version 0.29 is done.

Internal Changes
  • New item type, "TYPE_AMMO"
  • New item attribute, "ammo_type"
  • Class information is now loaded from a file for character creation.

Visual Changes
  • Made items brown on the map, to differentiate them from enemies.
  • Fixed items sometimes not being drawn.
  • Item purchase screen updated to allow the purchase of multiples.

Gameplay Changes
  • Ranged weapons are in, they can be used as melee weapons, or fire projectiles.  Press 'f' to fire.
  • Ammo will stack when picked up, purchased or fired.
  • Enemies will not block a shot, so you can shoot past one enemy to hit another.
  • Fixed doors being placed on the right and bottom outer walls.
  • Look function now lets you pick a square to look at.

Editor Changes
  • Item editor and item.raw format updated for ammo_type
  • Icons added for editors

Download is in the first post as usual.  The biggest changes this time are the ranged weapons and the movement of class information to an external file.  Ranged weapons will work just like melee weapons should you try to use them as such, but they have penalties instead of bonuses to strength and dexterity.  To use it to fire a projectile, press 'f', then choose a square to shoot at (if it doesn't let you pick a square, you probably don't have ammo).  The ammo items I've added have substantial bonuses to strength and/or dexterity, to make up for the weapon's penalties.  If you want to make a ranged weapon in the editor, make a normal weapon and give it an ammo type.  It can then be used to fire whatever type of projectile you chose.  At the moment, only weapons can launch projectiles.  I may change this later, especially if I grow too fond of the hidden, wrist-mounted pistol in Assassin's Creed 2 :P

All class information is now stored in external files, and loaded when you want to create a character.  The format is really simple, so I'll leave it for you to figure out.  One thing of note, you can only have ten classes (0-9), any classes past that will be ignored.

Also, I made a mistake in my previous post when I described how to set up an icon.  At least in CodeBlocks, the icon has to be in the same place as the source files.  You could probably specify a directory for it, but I have not tried.

[EDIT]:  Next version primary goal: Magic.  Here's what I've got so far, spells will be loaded from a file with a format similar to DF's raws to allow me to store more information in a single tag.  Of course, for this to work I'm going to have to write my own parser for them, so it may be a while before I have anything interesting to show.  I have some idea of what I want the files to look like:
Spoiler (click to show/hide)
Basically, a spell will consist of a name, a target (self and target to begin with, probably area effects later), and any number of effects.  I'm considering the possibility of allowing multiple targets, so you could have, say:
Spoiler (click to show/hide)
Which would heal you and hurt the target.  The format is far from perfect, and I may combine the duration tag into the effect tags, so each effect could have a different length.

As far as the actual code goes, I'll write a class that stores the name and target, as well as a vector of the effects, for a spell.  Then have a vector of all spells in the _game structure.  Items for the spells (scrolls, wands, whatever I decide to use) will be generated automatically.  The effects may end up needing a structure of their own, depending on how complicated they get. 

Duration would be the time an effect lasts, not the amount of time it takes to happen.  -1 would signify a permanent effect, while a positive number would be an amount of time (probably in turns) until the effect reverses itself.  (I.E. The "weaken" spell above would, after the 25 turns, reverse itself, giving the enemy back his missing strength point)
« Last Edit: November 11, 2009, 01:52:04 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.29 released 11/10/09!
« Reply #132 on: November 12, 2009, 12:14:54 am »

I've tried your latest version.
It's much more gamely now.

Here are issues:
-Random red things on map, "You see nothing".
-No more apples (I liked the apples)
-Corners of rooms are randomly doors:
Spoiler (click to show/hide)

Besides that, I think it's much more complete than before.
Keep up the good work.
I look forward to seeing you on MSN again soon.
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

alfie275

  • Bay Watcher
    • View Profile
Re: My C++ Game Projects - Tower of Azari v0.29 released 11/10/09!
« Reply #133 on: November 12, 2009, 01:29:40 pm »

@timmeh, how do you make your dungeons, ie, how do you check where to place rooms accessably?
Logged
I do LP of videogames!
See here:
http://www.youtube.com/user/MrAlfie275

Outcast Orange

  • Bay Watcher
  • [SOMETIMES_SQUID]
    • View Profile
    • The Outcast Orange
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
Pages: 1 ... 7 8 [9] 10 11 ... 29