Welcome, Guest. Please login or register.
March 29, 2024, 05:11:54 AM

Login with username, password and session length

Search:     Advanced search
we're back, baby
*
Home Help Search Login Register
f13.net  |  f13.net General Forums  |  The Gaming Graveyard  |  Game Design/Development  |  Topic: Time for my hobby project update again 0 Members and 1 Guest are viewing this topic.
Pages: [1] Go Down Print
Author Topic: Time for my hobby project update again  (Read 4000 times)
Margalis
Terracotta Army
Posts: 12335


on: November 27, 2005, 10:29:40 PM

Tonight I hit a pretty decent milestone - non trivial unit implementation.

I've finally hit the point where I have enough infrastructure in place that I can add new units relatively easily. Of course I still have to do coding for special abilities and such, but the basics are now there. The first "real" unit I've made is Orcish Artillery. They move slow and long range, splash damage attacks. Because there are some nerds here I figured I would post the XML file for the Artillery with some comments. (XML below)

The interesting thing in the XML is the attack list. Units can have more than one attack. Orcish Artillery has one, a projectile attack. It has a max range and a min range as well. The "splashIterator" is an area of effect thing. Typically attacks hit one square. However the artillery can hit the square that it aims for + 1 in each direction. (Roughly - it's a function of the cost function. The flying movement cost function is a function that doesn't cost anything to move downhill, whereas normal movement does cost something)

So this now allows a whole class of non-trivial units. For example to create a bow weilder I can just change the min and max range and use the default splash. (No area of effect) Or to create something like a cannon that can only fire in straight lines I just need to write a new cost function that only allows straight lines. (5 minutes of coding)

<unit class="units.UnitTemplate">
   <name>Orcish Artillery</name>
   <cost>20</cost>
   <color>red</color>

   <hp>30</hp>
   <movementPoints>3</movementPoints>
   <weight>40</weight>

   <portrait>orcish_artillery.jpg</portrait>
   
   <attackList class="actions.attack.AttackList">
      <attack class="actions.attack.ProjectileAttack">
         <name>Rocket Launch</name>
         <description>Fires a long-range projectile.</description>
         <power>10</power>
         <maxRange>6</maxRange>
         <minRange>2</minRange>
         <splashIterator class="map.iterators.CostBasedIterator">
            <maxCost>1</maxCost>
            <costFunction class="map.iterators.FlyingMovementCostFunction"/>
         </splashIterator>
      </attack>
   </attackList>
</unit>

At this point I have to do a couple of things:

1: Run though all the code and clean up a bunch of loose ends, mostly interface related. (For example if you attack with a unit it doesn't automatically snap back to the unit menu so you can do something else, you have to manually re-select it)

2: Create a real map and an ok unit variety. (Nothing fancy, maybe 5 fairly unique units, of which I have 3- archer, artillery and Serra Angel (flying) )

3: Put out a pre-alpha.

Things are rolling along slowly but surely.

vampirehipi23: I would enjoy a book written by a monkey and turned into a movie rather than this.
Typhon
Terracotta Army
Posts: 2493


Reply #1 on: November 28, 2005, 06:37:39 AM

The flying movement cost function is a function that doesn't cost anything to move downhill, whereas normal movement does cost something)

If I understand this correctly, the artillery shells can go further if you are shooting downhill.  Clever way to give the high ground an advantage, me likely.
Roac
Terracotta Army
Posts: 3338


Reply #2 on: November 28, 2005, 08:37:30 AM

I'm curious why you are assigning values to the attribute class.  Does this mean that you are instancing objects at runtime based on the XML?

-Roac
King of Ravens

"Young people who pretend to be wise to the ways of the world are mostly just cynics. Cynicism masquerades as wisdom, but it is the farthest thing from it. Because cynics don't learn anything. Because cynicism is a self-imposed blindness, a rejection of the world because we are afraid it will hurt us or disappoint us." -SC
Margalis
Terracotta Army
Posts: 12335


Reply #3 on: November 28, 2005, 02:55:40 PM

1: Yes, you can fire further downhill. You can't fire as far uphill or move as far uphill either. (Although flying units can move uphill easier) High ground rules for ranged units. (Bascially each block you are up higher gives you one more block of horizontal range, so if you are standing on a giant pillar you can hit the whole map)

2: Yes, I am instancing things at runtime. map.iterators.CostBasedIterator is an actual object with a setCostFunction() and setMaxCost() method. Some of these things have shortcuts already, for example movementType of flying equates to setMovementFunction() blah blah blah, but in the short term I don't want to create a bunch of shortcut syntax that makes it harder for me to understand and that will probably change anyway.

vampirehipi23: I would enjoy a book written by a monkey and turned into a movie rather than this.
Margalis
Terracotta Army
Posts: 12335


Reply #4 on: November 29, 2005, 11:42:15 PM

Just a random note, here are the units I've implemented so far. They aren't finished but they are pretty decent. I use the Magic:TG names for all my units that match the graphics right now, mostly to make it easier for me to keep track:

Orcish Artillery - fires long distances for ok splash damage. Poor movement.
Heavy Ballista - fires extremely long distance for large (non-splash) damage but only in straight lines. Poor movement.
Serra Angel - A flying beater.
Aven Archer - A flying archer.
Crossbow Infantry - A tougher, non-flying version of the above.
Dakmor Lancer - Can attack on straight lines 2 spaces away (normal weapons are 1 space). I also want to give guys on horses the ability to attack and then move, or maybe even move, attack, move some more. (Right now you always have to move first)

Anyway that's enough for me for a proof of concept. It only took me a few minutes to implement the Lancer and Ballista (had to write a new range function that restricted to straight lines) so I think the approach is solid. Now I just have to clean up the code, polish so UI issues and I can have a pre-Alpha thingy.

I'm updating my website (www.geocities.com/margalisix - yes, I have a geocities website laugh all you want) with a new screen or two.

vampirehipi23: I would enjoy a book written by a monkey and turned into a movie rather than this.
Typhon
Terracotta Army
Posts: 2493


Reply #5 on: November 30, 2005, 04:04:45 AM

Is it a hex map, or a grid?  i.e. is "straightline" two axis or three?  Do units have a facing and turning costs?
Roac
Terracotta Army
Posts: 3338


Reply #6 on: November 30, 2005, 06:44:43 AM

Is it a hex map, or a grid?  i.e. is "straightline" two axis or three?  Do units have a facing and turning costs?

Grid.  Some info is available at his website, if you haven't seen it - linkity.

-Roac
King of Ravens

"Young people who pretend to be wise to the ways of the world are mostly just cynics. Cynicism masquerades as wisdom, but it is the farthest thing from it. Because cynics don't learn anything. Because cynicism is a self-imposed blindness, a rejection of the world because we are afraid it will hurt us or disappoint us." -SC
Margalis
Terracotta Army
Posts: 12335


Reply #7 on: November 30, 2005, 09:23:19 AM

I wanted to have units face different directions but I can't figure out how to represent it graphically...if I ever do then that will probably make it in.

vampirehipi23: I would enjoy a book written by a monkey and turned into a movie rather than this.
Roac
Terracotta Army
Posts: 3338


Reply #8 on: November 30, 2005, 09:27:31 AM

I wanted to have units face different directions but I can't figure out how to represent it graphically...if I ever do then that will probably make it in.

Are your card types generic enough that you can create "category" pieces?  I doubt you'd want to uniquely detail every card you have (that's why you're using stock art for the cards, right?), but do you have categories to make 2-5 types of figures, like "infantry", "ranged", "artillary", "flying", etc?  It would keep the number of models low.  Click on the model for specific info (card img, stats, etc).

-Roac
King of Ravens

"Young people who pretend to be wise to the ways of the world are mostly just cynics. Cynicism masquerades as wisdom, but it is the farthest thing from it. Because cynics don't learn anything. Because cynicism is a self-imposed blindness, a rejection of the world because we are afraid it will hurt us or disappoint us." -SC
Pococurante
Terracotta Army
Posts: 2060


Reply #9 on: November 30, 2005, 09:40:30 AM

I wanted to have units face different directions but I can't figure out how to represent it graphically...if I ever do then that will probably make it in.

Dynamic adornment/layers - just hang off the card or in the card's border a mini compass or the letter of a cardinal direction overlaying a semi-opaque red arrow.
Roac
Terracotta Army
Posts: 3338


Reply #10 on: November 30, 2005, 09:49:34 AM

You know, if direction is put in, you can start to think about all sorts of complicated maneuvers.  Flanking would be the most obvious; frontal assault on a unit's side.  Or add a flanking maneuver which may be something like this: two units are frontal-facing, and the attacker gets to move forward/diagonal, turn to face opponent, and attack all in one go (with penalty?).  Or allow for supporting units to share defense and/or counterattack such maneuvers.

Then again, depends on how chess-like the game is, but with different types of maneuvering and reinforcement, you can start to picture various formations being relevant.

-Roac
King of Ravens

"Young people who pretend to be wise to the ways of the world are mostly just cynics. Cynicism masquerades as wisdom, but it is the farthest thing from it. Because cynics don't learn anything. Because cynicism is a self-imposed blindness, a rejection of the world because we are afraid it will hurt us or disappoint us." -SC
Margalis
Terracotta Army
Posts: 12335


Reply #11 on: November 30, 2005, 10:17:15 AM

Yeah I would like to add the facing stuff. I think it's important to be able to see it from the map without selecting a unit. I'm sure I will get it in there eventually. In my original mockups I had a little arrow representing the direction the unit was facing.

At the very least I would do something like side or back attacks do more damage or something like that.

vampirehipi23: I would enjoy a book written by a monkey and turned into a movie rather than this.
Typhon
Terracotta Army
Posts: 2493


Reply #12 on: November 30, 2005, 04:20:01 PM

Sorry I posted the dumb question about the grid this morning, was early and I didn't think of just going and looking and/or remember.

Glad I asked about facing, as I think they give the calvary-type units enough versatility that they can be lighter armed and armored then the armored units but still pose a credible threat if used by someone who is good with positioning hit/run.
Pococurante
Terracotta Army
Posts: 2060


Reply #13 on: November 30, 2005, 07:05:00 PM

Glad I asked about facing, as I think they give the calvary-type units enough versatility that they can be lighter armed and armored then the armored units but still pose a credible threat if used by someone who is good with positioning hit/run.

"Forward, the Light Brigade!"
Was there a man dismay'd?
Not tho' the soldier knew
 Someone had blunder'd:
Their's not to make reply,
Their's not to reason why,
Their's but to do and die:
Into the valley of Death
 Rode the six hundred.

Margalis
Terracotta Army
Posts: 12335


Reply #14 on: November 30, 2005, 08:13:12 PM

Sorry I posted the dumb question about the grid this morning, was early and I didn't think of just going and looking and/or remember.

There are no dumb questions!

Only dumb people.  tongue

Ha ha just kidding...

vampirehipi23: I would enjoy a book written by a monkey and turned into a movie rather than this.
Roac
Terracotta Army
Posts: 3338


Reply #15 on: December 01, 2005, 06:06:36 AM

There are no dumb questions!

Only dumb people.  tongue

Mmm'kay, Mr. Garrison  :-D

-Roac
King of Ravens

"Young people who pretend to be wise to the ways of the world are mostly just cynics. Cynicism masquerades as wisdom, but it is the farthest thing from it. Because cynics don't learn anything. Because cynicism is a self-imposed blindness, a rejection of the world because we are afraid it will hurt us or disappoint us." -SC
Pages: [1] Go Up Print 
f13.net  |  f13.net General Forums  |  The Gaming Graveyard  |  Game Design/Development  |  Topic: Time for my hobby project update again  
Jump to:  

Powered by SMF 1.1.10 | SMF © 2006-2009, Simple Machines LLC