Author Topic: some ideas  (Read 2795 times)

bork

  • Guest
some ideas
« on: 14 March 2009, 22:14:54 »
- Group several buildings as well as regular units. I think, it'd be great to build several creatures simultaneously.

- Add moving point to summoners and other (if any) units that can act as units producers.

- Select move/attack/harvest targets with minimap.

I, also, implemented some simple changes by myself. I have a patch which enables centering on group by pressing this groups number 2 or more times. I can share this patch if source code mantainer(s) is interested in commiting it.

I'd also like to try implementing commands queuing like in Starcraft (http://www.battle.net/scc/GS/control.shtml#que) if such change could have a chance to be commited.

wciow

  • Behemoth
  • *******
  • Posts: 968
    • View Profile
Re: some ideas
« Reply #1 on: 14 March 2009, 23:13:27 »
Your code would be very much welcome for the G(lest)A(dvanced)E(ngine) project.
https://forum.megaglest.org/index.php?board=15.0

You could submit your patch to Martinho (glest creator) but it is unlikely that he will add it since he has officially stopped maintaining Glest since 3.1.2

Or you could make your own branch for Glest and release it yourself.
Check out my new Goblin faction - https://forum.megaglest.org/index.php?topic=9658.0

bork

  • Guest
Re: some ideas
« Reply #2 on: 15 March 2009, 08:44:11 »
Thanks, a lot! I think, I'll try GAE then.

hailstone

  • GAE Team
  • Battle Machine
  • ********
  • Posts: 1,568
    • View Profile
Re: some ideas
« Reply #3 on: 15 March 2009, 09:34:54 »
I am interested.
Glest Advanced Engine - Admin/Programmer
https://sourceforge.net/projects/glestae/

bork

  • Guest
Re: some ideas
« Reply #4 on: 27 March 2009, 20:21:35 »
Sorry, for delay, I'm started to playing with GAE and didn't look at glest forum. Here are two patches for glest and gae trunks which add centering on group by pressing this groups number two or more times.

patch for gae:
Code: [Select]
Index: gui.cpp
===================================================================
--- gui.cpp     (revision 302)
+++ gui.cpp     (working copy)
@@ -99,6 +99,7 @@
        shiftDown = false;
        controlDown = false;
        activePos= invalidPos;
+       currentGroup= invalidGroupIndex;
 }
 
 void Gui::init(Game *game){
@@ -382,7 +383,12 @@
                selection.assignGroup(groupIndex);
        }
        else{
+               if(currentGroup == groupIndex){
+                       centerCameraOnSelection();
+               }
+
                selection.recallGroup(groupIndex);
+               currentGroup= groupIndex;
        }
 }
 
Index: gui.h
===================================================================
--- gui.h       (revision 302)
+++ gui.h       (working copy)
@@ -99,6 +99,7 @@
        static const int imageCount= 16;
        static const int invalidPos= -1;
        static const int doubleClickSelectionRadius= 20;
+       static const int invalidGroupIndex= -1;
 
        typedef vector<Vec2i> BuildPositions;
 
@@ -139,6 +140,7 @@
        bool selectingMeetingPoint;
        bool shiftDown;
        bool controlDown;
+       int currentGroup;
 
 public:
        Gui();
@@ -213,6 +215,10 @@
                computeDisplay();
        }
 
+       void onSelectionUpdated(){
+               currentGroup= invalidGroupIndex;
+       }
+
        void onSelectionStateChanged(){
                selection.update();
                computeDisplay();
Index: selection.cpp
===================================================================
--- selection.cpp       (revision 302)
+++ selection.cpp       (working copy)
@@ -258,6 +258,8 @@
 
                meetable = uniform && commandable && frontUT->hasMeetingPoint();
        }
+
+       gui->onSelectionUpdated();
 }
 
 }}//end namespace

patch for glest:
Code: [Select]
Index: gui.cpp
===================================================================
--- gui.cpp     (revision 191)
+++ gui.cpp     (working copy)
@@ -96,6 +96,7 @@
        selectingPos= false;
        selectingMeetingPoint= false;
        activePos= invalidPos;
+       currentGroup= invalidGroupIndex;
 }
 
 void Gui::init(Game *game){
@@ -266,7 +267,12 @@
                selection.assignGroup(groupIndex);
        }
        else{
+               if(currentGroup == groupIndex){
+                       centerCameraOnSelection();
+               }
+
                selection.recallGroup(groupIndex);
+               currentGroup= groupIndex;
        }
 }
 
@@ -303,6 +309,7 @@
 void Gui::onSelectionChanged(){
        resetState();
        computeDisplay();
+       onSelectionUpdate();
 }
 
 // ================= PRIVATE =================
Index: gui.h
===================================================================
--- gui.h       (revision 191)
+++ gui.h       (working copy)
@@ -98,6 +98,7 @@
        static const int imageCount= 16;
        static const int invalidPos= -1;
        static const int doubleClickSelectionRadius= 20;
+       static const int invalidGroupIndex= -1;
 
 private:
        //External objects
@@ -128,6 +129,7 @@
        bool selectingBuilding;
        bool selectingPos;
        bool selectingMeetingPoint;
+       int currentGroup;
 
 public:
        Gui();
@@ -171,6 +173,10 @@
        //misc
        void onSelectionChanged();
 
+       void onSelectionUpdated(){
+               currentGroup= invalidGroupIndex;
+       }
+
 private:
       
        //orders
Index: selection.cpp
===================================================================
--- selection.cpp       (revision 191)
+++ selection.cpp       (working copy)
@@ -107,6 +107,7 @@
 void Selection::clear(){   
        //clear list
        selectedUnits.clear();
+       gui->onSelectionUpdated();
 }
 
 bool Selection::isUniform() const{
« Last Edit: 27 March 2009, 20:54:17 by bork »

madmanntis

  • Guest
Re: some ideas
« Reply #5 on: 16 April 2009, 17:48:45 »
Cool patch. Question: how/where do I insert the patch?

bork

  • Guest
Re: some ideas
« Reply #6 on: 20 April 2009, 17:56:06 »
Cool patch. Question: how/where do I insert the patch?

You need to get source code of glest first. Then create a file named group-centering.patch (or any other name you like) and paste patch contents into it. If you are using Linux you then just cd path_to_glest_source/source/game/gui && patch < path_to_patch/group-centering.patch. On Windows you'll need some tool which can handle .patch files. There should be a win32 port of 'patch', I think, or you can try TortoiseSVN, it can apply patches as one of it's functions.

hailstone

  • GAE Team
  • Battle Machine
  • ********
  • Posts: 1,568
    • View Profile
Re: some ideas
« Reply #7 on: 6 June 2009, 10:13:24 »
I've implemented Bork's patch at r35 in GAE Sourceforge trunk. Working nicely, thanks Bork.

PS: Tortoise SVN is able to handle patches. Also if you have anything else to add to GAE just sign up to Sourceforge and let me know.
« Last Edit: 6 June 2009, 10:15:31 by hailstone »
Glest Advanced Engine - Admin/Programmer
https://sourceforge.net/projects/glestae/

 

anything