Welcome, Guest. Please login or register. Did you miss your activation email?

Author Topic: Cloud Wars - WIP  (Read 10059 times)

0 Members and 1 Guest are viewing this topic.

raycrasher

  • Newbie
  • *
  • Posts: 24
    • View Profile
Cloud Wars - WIP
« on: July 18, 2012, 02:38:12 pm »
Hello!

I would like to present my pet project, Cloud Wars - a space tactical game in the spirit of Battleships Forever(http://www.wyrdysm.com/games.php), but with significant RPG elements. It is still very much a work in progress - all that is finished are the Ship Editor, the GUI (libRocket), the Lua script bindings (Diluculum and SLB), resource managers, particle systems, Box2d physics, and other bits and pieces. The ship sprites are from community resources from Battleships Forever (I have asked permission), slightly edited. All other resources are made by me or from public domain graphics (such as nebulae)

The reason why I'm posting this unfinished project is that I just want to hear ideas from the community for me to mull over whenever I'm stuck. If you want a look at the code, I can send you the code and data.

Some areas on which I need feedback are on the following:

  • Steering behaviors with Box2d. I already read Steering Behaviors for Autonomous Characters (www.red3d.com/cwr/steer/ ) and I'm basing the code from this. The thing that I'm not sure of is how to apply the resultant steering vector to the ship. Thrusters? Pull the ship by the nose? (I tried the latter, it works, but you get some kind of pendulum effect (can be mitigated), and I can't simulate thrusters.) Also, prioritizing/blending steering vectors.
  • A console-based alternative input system, using a syntax somewhat similar to natural language. For example, typing "Leviathan attack all", or "Grizzly retreat BaseRallyPoint" will give the corresponding orders to the named ships. Of course you can use the mouse/keyboard shortcuts, but you can set advanced orders through a console, like "All ships set DefensivePerimeter at WarpPointAlpha radius 500m until enemy detected at Sector Beta or timeout 5min". Automatic suggestions are also available as you type.
  • Control ANY entity, from small fighters, to large ships, to fleets. Different control systems for fighters, gunships, ships and fleets.

I can also offer working code for sprite batching, particle systems, the libRocket GUI interfaces, and the Lua scripting system if anyone's interested.

Thank you for SFML - it's a really great library!



Screenies:
« Last Edit: July 18, 2012, 02:43:17 pm by raycrasher »

Grimshaw

  • Hero Member
  • *****
  • Posts: 631
  • Nephilim SDK
    • View Profile
Re: Cloud Wars - WIP
« Reply #1 on: July 18, 2012, 03:07:47 pm »
What?!! Sick! Amazing :D:D:D::D

Nexus

  • SFML Team
  • Hero Member
  • *****
  • Posts: 6287
  • Thor Developer
    • View Profile
    • Bromeon
Re: Cloud Wars - WIP
« Reply #2 on: July 20, 2012, 06:01:15 pm »
Looks great so far, and the technical background sounds quite interesting.

Steering behaviors with Box2d. I already read Steering Behaviors for Autonomous Characters (www.red3d.com/cwr/steer/ ) and I'm basing the code from this. The thing that I'm not sure of is how to apply the resultant steering vector to the ship. Thrusters? Pull the ship by the nose? (I tried the latter, it works, but you get some kind of pendulum effect (can be mitigated), and I can't simulate thrusters.)
Coincidentally, I have had the same problem a week ago. I am currently experimenting with aircraft formations, and taking a closer look at the steering behaviors (also at that page). For the moment, I leave a small tolerance angle inside which no corrections are performed -- tuned such that when thrusters stop, the remaining inertia is enough to align a plane correctly. But this is more a temporary solution.

I wonder how this is usually solved, too. While a gradually decreasing side-thrust can lead to a correct alignment, it may take longer than necessary. Maybe even advanced control systems (like PID controllers) that minimize the settling time and overshoot?
Zloxx II: action platformer
Thor Library: particle systems, animations, dot products, ...
SFML Game Development:

raycrasher

  • Newbie
  • *
  • Posts: 24
    • View Profile
Re: Cloud Wars - WIP
« Reply #3 on: July 21, 2012, 11:04:52 am »
Thanks for the replies! :)

Anyway, I just finished the steering behaviors the other day, and the ships are now chasing each other all over the screen. I went with the simple solution, which is to apply the desired vector as a force somewhere near the ship's nose, increase angular damping to about 0.8, and multiply the angular rotation by 0.95 when the heading of the desired vector is less than 30 degrees. Its an ugly hack, but it gives good results. I'm going to simulate thrusters firing with data retrieved from b2Body::GetLinearVelocityFromLocalPoint.

In the works - using Lua as a scripting language for RML (Rocket Markup Language, an HTML/CSS-like language for the GUI), should be simple enough, but there's much work to be done refactoring the mess inside ShipEditor. When it's done, I can then use Lua inside RML element event handlers, like:
<button id="myButton" onclick="Gui.Document('MainMenu'):GetElementByID('myButton'):SetInnerRML('You clicked me')">Click</button>

raycrasher

  • Newbie
  • *
  • Posts: 24
    • View Profile
Re: Cloud Wars - WIP
« Reply #4 on: July 17, 2013, 10:23:25 am »
After one year...

AN UPDATE! Yay!

It has been almost year since the last post, but the game has had significant developments. Specifically, I grew tired of the compile times I am getting with C++ (I use Boost!). So I switched to C#, and used a custom C++/CLI wrapper around the C++ SFML libraries to improve performance and get around the glitches I was getting with the .NET version of SFML. The game is not yet finished, but I am really planning on finishing this before March of next year, especially because this is my thesis project.

Here is the result so far:







Yemeni Cpluspluser

  • Newbie
  • *
  • Posts: 25
  • C/C++, Soon Java and SQL ^_^
    • View Profile
    • Email
Re: Cloud Wars - WIP
« Reply #5 on: July 17, 2013, 06:40:53 pm »
It seems that it used more of GameMaker 8.1 or GMstudio engines then SFML engine, or I am just imagining.
Any way, you should be proud that my first post is in your topic  :P
sf::signature mySignature;
mySignature.setPosition(forum.x,forum.y);
window.draw(mySignature);

Erikpetrov

  • Newbie
  • *
  • Posts: 13
    • View Profile
    • Greedy Truck
    • Email
Re: Cloud Wars - WIP
« Reply #6 on: July 18, 2013, 09:45:24 am »
I've played this game a long time ago.It's cool.Basicly when i played it was made in GameMaker.
Game: Greedy Truck
Website: http://greedytruck.tk/
Location: Earth(for now)

raycrasher

  • Newbie
  • *
  • Posts: 24
    • View Profile
Re: Cloud Wars - WIP
« Reply #7 on: July 18, 2013, 01:29:51 pm »
Yeah, it's basically a clone of Battleships Forever. I even asked permission on the BSF forum for use of the sprites. They didn't seem to mind. :) I've been playing BSF for a long time, and I thought of making a game like that just for kicks. And add a little spice to it while I'm at it.

However, this is made in C# and SFML 2.0, so its a LOT faster, especially when lots of ships and bullets are flying. And it has C# scripting support, for the modders.


Yemeni Cpluspluser

  • Newbie
  • *
  • Posts: 25
  • C/C++, Soon Java and SQL ^_^
    • View Profile
    • Email
Re: Cloud Wars - WIP
« Reply #8 on: July 28, 2013, 07:38:26 pm »
I can't wait to try your c# and SFML version of the game, the screen shots looks very exciting  ;D
sf::signature mySignature;
mySignature.setPosition(forum.x,forum.y);
window.draw(mySignature);