Author Topic: Pause button  (Read 11330 times)

DemiGod

  • Guest
Pause button
« on: 3 July 2007, 22:12:24 »
A pause button is something all strategy games have exept glest. If anyone has any idea on how to make one please reply.

And if this is possible would the glest team incorporate it in thier next version of glest?
« Last Edit: 1 January 1970, 00:00:00 by DemiGod »

hailstone

  • GAE Team
  • Battle Machine
  • ********
  • Posts: 1,568
    • View Profile
(No subject)
« Reply #1 on: 4 July 2007, 12:39:01 »
It might be possible by stopping a timer. I'll look at it a bit closer later.
« Last Edit: 1 January 1970, 00:00:00 by hailstone »
Glest Advanced Engine - Admin/Programmer
https://sourceforge.net/projects/glestae/

titi

  • MegaGlest Team
  • Airship
  • ********
  • Posts: 4,240
    • View Profile
    • http://www.titusgames.de
(No subject)
« Reply #2 on: 4 July 2007, 13:15:50 »
« Last Edit: 1 January 1970, 00:00:00 by titi »
Try Megaglest! Improved Engine / New factions / New tilesets / New maps / New scenarios

andyglest

  • Guest
(No subject)
« Reply #3 on: 4 July 2007, 13:30:36 »
yup, press P on keyboard and you will turn on pause. you can speed up or down using - and + on your keyboard.
« Last Edit: 1 January 1970, 00:00:00 by andyglest »

DemiGod

  • Guest
(No subject)
« Reply #4 on: 4 July 2007, 16:45:17 »
Thanks guess I was a bit lazy :-[
« Last Edit: 1 January 1970, 00:00:00 by DemiGod »

andyglest

  • Guest
(No subject)
« Reply #5 on: 4 July 2007, 18:50:46 »
Quote from: "DemiGod"
Thanks guess I was a bit lazy :wink: you just learn one of the most important things. browse a forum a little and you will see some useful tips about playing glest if you are beginner.
« Last Edit: 1 January 1970, 00:00:00 by andyglest »

hailstone

  • GAE Team
  • Battle Machine
  • ********
  • Posts: 1,568
    • View Profile
(No subject)
« Reply #6 on: 4 July 2007, 23:53:01 »
Now I feel stupid lol :-[  Should have checked first.
« Last Edit: 1 January 1970, 00:00:00 by hailstone »
Glest Advanced Engine - Admin/Programmer
https://sourceforge.net/projects/glestae/

andyglest

  • Guest
(No subject)
« Reply #7 on: 5 July 2007, 00:03:39 »
Quote from: "hailstone"
Now I feel stupid lol :D
« Last Edit: 1 January 1970, 00:00:00 by andyglest »

DemiGod

  • Guest
(No subject)
« Reply #8 on: 5 July 2007, 13:17:34 »
p button works fine, although i'd prefer it to be the pause/break button so if i can download the source code i'll change it
« Last Edit: 1 January 1970, 00:00:00 by DemiGod »

andyglest

  • Guest
(No subject)
« Reply #9 on: 5 July 2007, 14:25:35 »
i think the keys P, pause/break and Space should be used (all of them) to pause the game. to me space will be best because i pause game very often, and that's big key.
« Last Edit: 1 January 1970, 00:00:00 by andyglest »

RainCT

  • Guest
(No subject)
« Reply #10 on: 5 July 2007, 19:51:31 »
Quote from: "andyglest"
i think the keys P, pause/break and Space should be used (all of them) to pause the game. to me space will be best because i pause game very often, and that's big key.


I don't agree that space should pause the game.

And... Are you cheating?  ::)   xDDD
« Last Edit: 1 January 1970, 00:00:00 by RainCT »

DemiGod

  • Guest
(No subject)
« Reply #11 on: 8 July 2007, 20:16:29 »
Here is an idea for someone who has access to the source code: all units and buildings diisapear when paused
« Last Edit: 1 January 1970, 00:00:00 by DemiGod »

hailstone

  • GAE Team
  • Battle Machine
  • ********
  • Posts: 1,568
    • View Profile
(No subject)
« Reply #12 on: 8 July 2007, 20:23:46 »
Quote
someone who has access to the source code

Every one has access to the latest source via the SVN.  ;)
 
Sounds like a good idea, although I'm not sure how CPU intensive that would be or how difficult it would be to implement.
« Last Edit: 1 January 1970, 00:00:00 by hailstone »
Glest Advanced Engine - Admin/Programmer
https://sourceforge.net/projects/glestae/

DemiGod

  • Guest
(No subject)
« Reply #13 on: 8 July 2007, 20:27:35 »
Okay I mean some one who is not at home for the holiday with a 100kbps dial up modem, waiting to get back to skool where he/she has unlimited access to 1mbps broadband
« Last Edit: 1 January 1970, 00:00:00 by DemiGod »

hailstone

  • GAE Team
  • Battle Machine
  • ********
  • Posts: 1,568
    • View Profile
(No subject)
« Reply #14 on: 8 July 2007, 22:01:16 »
Yeah it's strange how the same sentence can mean something different to another person. Browsing the SVN on Sourceforge might be quicker.

I've had a quick look at the source and it might be possible in game.cpp

The code might be changed to something like

Code: [Select]
void Game::render3d(){
...
...
//selection circles
renderer.renderSelectionEffects();

if (!paused){
//units
renderer.renderUnits();

//objects
renderer.renderObjects();
}

//water
renderer.renderWater();
renderer.renderWaterEffects();
...
...
}

The method is called by Game::render() which is virtual from ProgramState::render() which is called by Program::loop() which is called by glestMain()

like
Code: [Select]
while(Window::handleEvent()){
program->loop();
}
« Last Edit: 1 January 1970, 00:00:00 by hailstone »
Glest Advanced Engine - Admin/Programmer
https://sourceforge.net/projects/glestae/

hailstone

  • GAE Team
  • Battle Machine
  • ********
  • Posts: 1,568
    • View Profile
(No subject)
« Reply #15 on: 15 July 2007, 12:45:26 »
It works!!!! except I'm only going to remove units and selection.

Code: [Select]
if (!paused){
//selection circles
renderer.renderSelectionEffects();

//units
renderer.renderUnits();
}
« Last Edit: 1 January 1970, 00:00:00 by hailstone »
Glest Advanced Engine - Admin/Programmer
https://sourceforge.net/projects/glestae/

eddyp

  • Guest
(No subject)
« Reply #16 on: 15 July 2007, 15:25:48 »
Quote from: "DemiGod"
p button works fine, although i'd prefer it to be the pause/break button so if i can download the source code i'll change it


This is a bad idea, some systems like the powerbooks (don't know about macbooks, but I guess is the same) don't have such a key.
« Last Edit: 1 January 1970, 00:00:00 by eddyp »

RainCT

  • Guest
(No subject)
« Reply #17 on: 15 July 2007, 16:21:58 »
Quote from: "eddyp"
Quote from: "DemiGod"
p button works fine, although i'd prefer it to be the pause/break button so if i can download the source code i'll change it

This is a bad idea, some systems like the powerbooks (don't know about macbooks, but I guess is the same) don't have such a key.


Well, why not let both do it? :)
« Last Edit: 1 January 1970, 00:00:00 by RainCT »

eddyp

  • Guest
(No subject)
« Reply #18 on: 16 July 2007, 06:37:18 »
Quote from: "RainCT"
Quote from: "eddyp"
Quote from: "DemiGod"
p button works fine, although i'd prefer it to be the pause/break button so if i can download the source code i'll change it

This is a bad idea, some systems like the powerbooks (don't know about macbooks, but I guess is the same) don't have such a key.

Well, why not let both do it? :)


well, that could work, but sincerely I think that p is rather common while space is really intuitive.
« Last Edit: 1 January 1970, 00:00:00 by eddyp »

hailstone

  • GAE Team
  • Battle Machine
  • ********
  • Posts: 1,568
    • View Profile
(No subject)
« Reply #19 on: 16 July 2007, 07:44:47 »
This is an easy thing to change if the keycode for space existed.

Keycode constants are stored in shared_lib/include/platform/sdl/window.h or win32/window.h depending on platform. The constant names will be the same.

If you wanted space as pause then the code would look like:
In /glest_game/game/game.cpp
Code: [Select]
void Game::keyDown(char key){
...
...
       //pause
else if(key==vkSpace){ // here is the change
                if(paused){
console.addLine(lang.get("GameResumed"));
paused= false;
}
else{
console.addLine(lang.get("GamePaused"));
paused= true;
}
}
...
...


The keycode constant needs to be added to the shared_lib before it will work.
« Last Edit: 1 January 1970, 00:00:00 by hailstone »
Glest Advanced Engine - Admin/Programmer
https://sourceforge.net/projects/glestae/

RainCT

  • Guest
(No subject)
« Reply #20 on: 16 July 2007, 09:55:38 »
Quote from: "eddyp"
but sincerely I think that p is rather common while space is really intuitive.


Well... I think pausing a game is the only function I've never seen being done by space lol
« Last Edit: 1 January 1970, 00:00:00 by RainCT »

andyglest

  • Guest
(No subject)
« Reply #21 on: 16 July 2007, 15:53:52 »
NEVER? space is very often used in strategy games for pause. it is better than P because P is one in... cca.40 keys around it, and holding finger on it is weird. that is why we need to put it on space. well, pause is only function on keyboard that is alone and used often. w,a,s,d are keys together, so they can stay there. key T for screenshot is not used very often, so it can stay there too.
« Last Edit: 1 January 1970, 00:00:00 by andyglest »

titi

  • MegaGlest Team
  • Airship
  • ********
  • Posts: 4,240
    • View Profile
    • http://www.titusgames.de
(No subject)
« Reply #22 on: 17 July 2007, 11:08:33 »
I like the 'P' and I think we have no "Pause" problem.

I don't like  the free camera look steering. Tribal Trouble has a much better one. Probabaly this can be implemented, so the free camera look gets useful when playing glest. This would be a real feature.
« Last Edit: 1 January 1970, 00:00:00 by titi »
Try Megaglest! Improved Engine / New factions / New tilesets / New maps / New scenarios