Author Topic: Super Awesome RTS Project  (Read 7550 times)

0 Members and 1 Guest are viewing this topic.

Offline Builderboy

  • Physics Guru
  • CoT Emeritus
  • LV13 Extreme Addict (Next: 9001)
  • *
  • Posts: 5673
  • Rating: +613/-9
  • Would you kindly?
    • View Profile
Super Awesome RTS Project
« on: May 20, 2012, 09:58:19 pm »
For the last couple weeks, I have been working on and off on an Real Time Strategy engine, with the final goal to be the creation of a fully featured RTS game for the calculator.  It has been quite a struggle with different types of data structures, but a lot of progress has been made since its inception.  I was reluctant to post this on the forums for a while due to it being such a large project, and because I has having such difficulty getting some of the foundations of the engine working.  However, just today I have solidified the basics of the engine.

However, the worries of this project being too much to handle for just one person still remain, so I am proposing that this be a completely open source project from the start.  This will not be a community project though, as I will still be doing most of the coding.  The idea is that from the start, anybody who is interested can take a look at the code and propose changes or optimizations as the development cycle goes on. Furthermore, I will not just be uploading the source, but simply zipping my entire development folder for all to see, so you will get to see all past backups, screenshots, and development notes that I create for myself.

The engine itself is one of the most complex I have ever written, and is still only in it's infancy.  It is being written with multiplayer in mind, so transitioning into link-play should not be difficult.  Link play will most likely come before any type of official AI, although both are planned (hoped for).  Currently the engine has these features:
 -64 units per player.  Each unit is 4x4 pixels
 -64x64 tilemap.  Each tile is 4x4 pixels, but all buildings take up an 8x8 space
 -256 4x4 'chunks' that are used in internal processing
 -Rudimentary pathing

The chunk system is the thing I have been working on for the past couple days, and it is finally working to my satisfaction.  Each player has a 832 byte section of memory allocated to all their units.  This consists of a 256 byte lookup table, and then 9 sets of 64 byte lists, each list for a different attribute.  The data structure that I chose is a linked list, and each chunk is it's own linked list.  The 256 byte lookup table has 1 byte for each chunk, and this byte points to a single object that exists within the chunk (or nowhere if there is no unit in that chunk).  Each unit then points to the next unit in the chunk, or nowhere if this is the last unit.  I have routines for adding units into the world, deleting from the world, and moving from 1 chunk to another, and they are all very efficient.  The deletion routine is just 2 simple lines, and the movement routine is equally simple.  Both moving and deletion run in constant time, while addition runs in linear time (although still very quickly). 

The pathing system is also a piece of code that was very time consuming to get working.  It is quite complicated, but I will go over the basics here.  When you order a select number of units to move to a specific location, the program does a depth fill from the destination location through the map until it locates all units (or until it has searched the whole map).  After this depth map, it generates a movement tree that all objects follow in order to get to the destination location.  Right now the way that this pathing tree is followed is very simple and often results in some traffic jams, but it is going to be improved in the future.

Anyways, that is all for now, I will leave you with a screenshot of all current progress, showcasing the unit selection and pathing routines.  I will also be uploading the development files for all to see, so enjoy!

For those of you who want to compile the latest version, you will want to go into the backups folder, choose the most recent version, and compile prgmAARTS.  Use the arrow keys to move the cursor, 2nd to select a region, alpha to toggle tiles, and Y= to send selected units to a location.

Offline Juju

  • Incredibly sexy mare
  • Coder Of Tomorrow
  • LV13 Extreme Addict (Next: 9001)
  • *************
  • Posts: 5730
  • Rating: +500/-19
  • Weird programmer
    • View Profile
    • juju2143's shed
Re: Super Awesome RTS Project
« Reply #1 on: May 20, 2012, 10:01:47 pm »
So it's gonna be some sort of Starcraft 83? I like. Also nice start for the pathing thing.

Remember the day the walrus started to fly...

I finally cleared my sig after 4 years you're happy now?
THEGAME
This signature is ridiculously large you've been warned.

The cute mare that used to be in my avatar is Yuki Kagayaki, you can follow her on Facebook and Tumblr.

Offline jsj795

  • LV9 Veteran (Next: 1337)
  • *********
  • Posts: 1105
  • Rating: +84/-3
    • View Profile
Re: Super Awesome RTS Project
« Reply #2 on: May 20, 2012, 10:05:19 pm »
how will you distinguish between your army and enemy's army? and how many different types of units will there be? Because 4x4 seems to be pretty limited for spriting :/


Spoiler For funny life mathematics:
1. ROMANCE MATHEMATICS
Smart man + smart woman = romance
Smart man + dumb woman = affair
Dumb man + smart woman = marriage
Dumb man + dumb woman = pregnancy
2. OFFICE ARITHMETIC
Smart boss + smart employee = profit
Smart boss + dumb employee = production
Dumb boss + smart employee = promotion
Dumb boss + dumb employee = overtime
3. SHOPPING MATH
A man will pay $2 for a $1 item he needs.
A woman will pay $1 for a $2 item that she doesn't need.
4. GENERAL EQUATIONS & STATISTICS
A woman worries about the future until she gets a husband.
A man never worries about the future until he gets a wife.
A successful man is one who makes more money than his wife can spend.
A successful woman is one who can find such a man.
5. HAPPINESS
To be happy with a man, you must understand him a lot and love him a little.
To be happy with a woman, you must love her a lot and not try to understand her at all.
6. LONGEVITY
Married men live longer than single men do, but married men are a lot more willing to die.
7. PROPENSITY TO CHANGE
A woman marries a man expecting he will change, but he doesn't.
A man marries a woman expecting that she won't change, and she does.
8. DISCUSSION TECHNIQUE
A woman has the last word in any argument.
Anything a man says after that is the beginning of a new argument.

Girls = Time * Money (Girls are a combination of time and money)
Time = Money (Time is money)
Girls = Money squared (So, girls are money squared)
Money = sqrt(Evil) (Money is also the root of all evil)
Girls = sqrt(Evil) squared (So, girls are the root of all evil squared)
Girls = Evil (Thus, girls are evil)
*Girls=Evil credit goes to Compynerd255*

Offline Builderboy

  • Physics Guru
  • CoT Emeritus
  • LV13 Extreme Addict (Next: 9001)
  • *
  • Posts: 5673
  • Rating: +613/-9
  • Would you kindly?
    • View Profile
Re: Super Awesome RTS Project
« Reply #3 on: May 20, 2012, 10:25:00 pm »
There will be a very small number of different types of units, both because of the sprite limitations, and because this is a calc game :P.  The way I am currently planning to differentiate between units is actually by shape instead of color.   One player will have circle based units while the other will have square based units. 

Offline squidgetx

  • Food.
  • CoT Emeritus
  • LV10 31337 u53r (Next: 2000)
  • *
  • Posts: 1881
  • Rating: +503/-17
  • rawr.
    • View Profile
Re: Super Awesome RTS Project
« Reply #4 on: May 20, 2012, 11:12:48 pm »
Good luck. Your data structure sounds solid: a good foundation to build on

Offline DJ Omnimaga

  • Clacualters are teh gr33t
  • CoT Emeritus
  • LV15 Omnimagician (Next: --)
  • *
  • Posts: 55941
  • Rating: +3154/-232
  • CodeWalrus founder & retired Omnimaga founder
    • View Profile
    • Dream of Omnimaga Music
Re: Super Awesome RTS Project
« Reply #5 on: May 21, 2012, 01:53:01 am »
O.O

Offline ZippyDee

  • LV8 Addict (Next: 1000)
  • ********
  • Posts: 729
  • Rating: +83/-8
  • Why not zoidberg?
    • View Profile
Re: Super Awesome RTS Project
« Reply #6 on: May 21, 2012, 06:12:35 am »
How are you approaching the pathing now, and how do you plan to approach it in the final game?

Edit: I guess my question is, how are you approaching the issues with coordinated pathing?
« Last Edit: May 22, 2012, 01:42:08 am by ZippyDee »
There's something about Tuesday...


Pushpins 'n' stuff...


Offline aeTIos

  • Nonbinary computing specialist
  • LV12 Extreme Poster (Next: 5000)
  • ************
  • Posts: 3915
  • Rating: +184/-32
    • View Profile
    • wank.party
Re: Super Awesome RTS Project
« Reply #7 on: May 22, 2012, 04:58:17 am »
Hum, to continue on that, could you pleeease post the pathing engine in a separate file? Wuold really help me and other ppl who want to create stuff that requires pathing.



sorry for the super bad grammar and spelling, not feeling like checking and fixing <.<
« Last Edit: May 22, 2012, 04:59:08 am by aeTIos »
I'm not a nerd but I pretend:

Offline Builderboy

  • Physics Guru
  • CoT Emeritus
  • LV13 Extreme Addict (Next: 9001)
  • *
  • Posts: 5673
  • Rating: +613/-9
  • Would you kindly?
    • View Profile
Re: Super Awesome RTS Project
« Reply #8 on: May 22, 2012, 02:47:42 pm »
How are you approaching the pathing now, and how do you plan to approach it in the final game?

Edit: I guess my question is, how are you approaching the issues with coordinated pathing?
Well, currently that is one of the largest challenges.  Right now each unit is trying to get to the destination with no consideration for the units around it.  This causes a lot of units running into each other and geeneral sadness.  Me and Runer are working together to get this working, but currently I am trying to see if giving units a formation 'goal' that they want to attain might be the way to go.

And aeTIos the source contains 3 different files that are used in the pathing routine.
-PCALCOFF-  Calculates the offsets that are given to each unit and initializes the routine data
-PATHFIND-  Generates the depth field
-PBLDTREE-   Uses the depth field to create a pathing tree, and assigns nodes to each unit

Offline Sorunome

  • Fox Fox Fox Fox Fox Fox Fox!
  • Support Staff
  • LV13 Extreme Addict (Next: 9001)
  • *************
  • Posts: 7920
  • Rating: +374/-13
  • Derpy Hooves
    • View Profile
    • My website! (You might lose the game)
Re: Super Awesome RTS Project
« Reply #9 on: May 23, 2012, 09:28:45 am »
Wha, it's looking quite cool!

THE GAME
Also, check out my website
If OmnomIRC is screwed up, blame me!
Click here to give me an internet!

Offline ZippyDee

  • LV8 Addict (Next: 1000)
  • ********
  • Posts: 729
  • Rating: +83/-8
  • Why not zoidberg?
    • View Profile
Re: Super Awesome RTS Project
« Reply #10 on: May 23, 2012, 03:51:07 pm »
This might be a useful tool for you to look at. I'm sure a lot of it wouldn't be entirely feasible in this game, but some of the concepts are still very valid.

http://www.gamasutra.com/view/feature/131720/coordinated_unit_movement.php
There's something about Tuesday...


Pushpins 'n' stuff...


Offline LincolnB

  • Check It Out Now
  • LV9 Veteran (Next: 1337)
  • *********
  • Posts: 1115
  • Rating: +125/-4
  • By Hackers For Hackers
    • View Profile
Re: Super Awesome RTS Project
« Reply #11 on: May 31, 2012, 01:11:51 pm »
Awesome! I will probably end up looking through the source at one point or another, mostly for my own learning purposes. I have a hard time seeing how I could contribute much of anything :D
Completed Projects:
   >> Spacky Emprise   >> Spacky 2 - Beta   >> Fantastic Sam
   >> An Exercise In Futility   >> GeoCore

My Current Projects:

Projects in Development:
In Medias Res - Contest Entry

Talk to me if you need help with Axe coding.


Spoiler For Bragging Rights:
Not much yet, hopefully this section will grow soon with time (and more contests)



Offline Keoni29

  • LV11 Super Veteran (Next: 3000)
  • ***********
  • Posts: 2466
  • Rating: +291/-16
    • View Profile
    • My electronics projects at 8times8
Re: Super Awesome RTS Project
« Reply #12 on: May 31, 2012, 03:12:56 pm »
Very nice. Are those blocks not OP?
If you like my work: why not give me an internet?








Offline Builderboy

  • Physics Guru
  • CoT Emeritus
  • LV13 Extreme Addict (Next: 9001)
  • *
  • Posts: 5673
  • Rating: +613/-9
  • Would you kindly?
    • View Profile
Re: Super Awesome RTS Project
« Reply #13 on: May 31, 2012, 10:33:25 pm »
Overpowered? ???

Offline leafy

  • CoT Emeritus
  • LV10 31337 u53r (Next: 2000)
  • *
  • Posts: 1554
  • Rating: +475/-97
  • Seizon senryakuuuu!
    • View Profile
    • keff.me
Re: Super Awesome RTS Project
« Reply #14 on: May 31, 2012, 11:19:43 pm »
Yeah, you should probably nerf the blocks a bit.
In-progress: Graviter (...)