Conquest! - Free Real-Time Strategy Game
  • Home
  • Start Playing
  • How to Play
  • About
    • Development Blog
    • History
    • Press Kit
    • Server Change Log
    • World Events
  • Login Help
  • Contact Us
  • Privacy Policy

Drag + Drop = Nightmare

9/20/2015

0 Comments

 
This week saw me tackle the hardest item (to date!) in Unity: formation maintenance.  In Conquest! players have the ability to define groups (or ranks) for their troops.  Troops in the front lines engage before those in the rear.  Troops with range can strike first from any formation.  This allows players to line up their "meat shields" to protect the (generally) more fragile ranged units.


The design in Unity called for a drag & drop interface, with groups dynamically added and removed.  I found a few tutorials on the new UI system in unity, which allowed me to get the drag and drop functionality working relatively quickly.  However, dynamically creating the group graphics and moving the icons took 2 days!


Most of this time was spent on Google, trying to wade through all the available documentation remotely related to my needs.  In the end, the biggest block was detecting where the mouse was when the user let go of an icon.  As easy as it seems now, this caused quite a bit of issues for me.  Eventually, I created a new project and went with just one icon.  Then I remembered that by default, Unity draws items from the middle, expanding both sides evenly.  In order to detect the leftmost edge I had to divide the center position by 2 and likewise for the rightmost edge.  I'm sure there are better ways of handling this but it worked!
Picture
The layouts of the group boxes are a little off but overall it is functioning!  After I got it working I took the APK file to the Test Droid cloud and the layout was all wrong.  Back to Unity.  I adjusted all the anchors (I had largely left them at the default due to being in a hurry) to correct the formatting issues.  Another test and this time my screens looked ok.  I went back to the other screens and corrected the anchors there too.

The Army screen received a new background this week.  The camp is now much more visible and really brings out the buttons.  Thank you Krees!
Picture
I also spent some time correcting some other minor formatting and coding issues.  One of the advantages of getting something working is now I get to go back and fix all the items I did while in development mode.  The army screen is now mostly complete.  We will move on to the Kingdom screens next which will provide additional challenges (I'm looking at you Fleet Maintenance!).


On the server side, there were just two new items: formation sends the troop numbers vs. the names (which made parsing the format much easier) and accepts a new command ("DEFAULT") to restore the game default.  I anticipate making additional changes to the engine as it transforms from serving text based clients to mobile ones.


The Kickstarter campaign picked up a few new pledges but we are a ways off.  Please consider supporting Conquest! with a pledge of any amount: http://kck.st/1LTthng


Follow the journey on Facebook or Twitter.  Until next time, I hope to see you in the game.
0 Comments



Leave a Reply.

    Author

    James has been working on Conquest! since 1993.

    Archives

    April 2025
    December 2024
    June 2024
    December 2023
    August 2023
    September 2022
    July 2022
    October 2021
    September 2021
    April 2021
    September 2020
    February 2017
    December 2016
    October 2016
    September 2016
    August 2016
    July 2016
    May 2016
    April 2016
    March 2016
    February 2016
    January 2016
    December 2015
    November 2015
    October 2015
    September 2015
    August 2015
    July 2015
    June 2015
    May 2015

    Categories

    All

    RSS Feed

Copyright 2025 GreenLion Gaming All Rights Reserved
  • Home
  • Start Playing
  • How to Play
  • About
    • Development Blog
    • History
    • Press Kit
    • Server Change Log
    • World Events
  • Login Help
  • Contact Us
  • Privacy Policy