Patch: New game in-game
Moderator: OpenTTD Developers
Patch: New game in-game
Usually when I play random maps it takes a couple of tries to get a map I like. And to create a map you need to go "Quit the current game, start a new game, tweek the settings, check out the new map, quit the current game, start a new game..." and that's the way I've been doing it for the last five years I've been playing openttd.
But today I thought "Don't be so lazy! It's open source for a reason. Start modifying!" and here it is: A very simple patch to add a "New game" option to the save/load menu. It pops up the new game dialog inside the current game. I hope having saved one (or maybe two?) mouse clicks makes you as warm inside as it makes me .
Comments and feedback are appreciated; it felt too easy so maybe there is a reason why this behavior isn't in trunk?
Edit:
v2: Updated patch to allow all inputs in the new game dialog to be edited.
But today I thought "Don't be so lazy! It's open source for a reason. Start modifying!" and here it is: A very simple patch to add a "New game" option to the save/load menu. It pops up the new game dialog inside the current game. I hope having saved one (or maybe two?) mouse clicks makes you as warm inside as it makes me .
Comments and feedback are appreciated; it felt too easy so maybe there is a reason why this behavior isn't in trunk?
Edit:
v2: Updated patch to allow all inputs in the new game dialog to be edited.
- Attachments
-
- newgameingame_v2_22731.diff
- (2.89 KiB) Downloaded 149 times
Last edited by loclahost on 09 Aug 2011 08:27, edited 1 time in total.
Re: Patch: New game in-game
Did you check wether the "old" map gets completely thrown away?
By that I mean that all used memory is cleared when creating a new map using your new menu item?
It's the only problem I could think of
By that I mean that all used memory is cleared when creating a new map using your new menu item?
It's the only problem I could think of
Re: Patch: New game in-game
I did use the system monitor to check for that. It showed no difference in ram usage when using my function ten times. I'm not really a c/c++ developer so I don't know how to profile more than that. gdb and gprof is not my home turfNickman wrote:By that I mean that all used memory is cleared when creating a new map using your new menu item?
Re: Patch: New game in-game
Don't have anything set up to compile, but this sounds like something I'd use. Nice idea, I like it!
Only think I can imagine that might go "wrong" is that you accidentally select the option from the menu and your current game is lost. I suppose that if you close the "New map" window, that your current game will remain usable? If so, then it's probably guarded enough, although an additional red warning "If you proceed, all unsaved progress of the current game will be lost. Continue? Yes/No" wouldn't hurt. Yes, it's an extra click but at least users are informed what they're about to do.
Only think I can imagine that might go "wrong" is that you accidentally select the option from the menu and your current game is lost. I suppose that if you close the "New map" window, that your current game will remain usable? If so, then it's probably guarded enough, although an additional red warning "If you proceed, all unsaved progress of the current game will be lost. Continue? Yes/No" wouldn't hurt. Yes, it's an extra click but at least users are informed what they're about to do.
Re: Patch: New game in-game
Yes, it opens up in a new, closeable window, just like when selecting "New game" from the start screen. If you close it the current game remains as it where before.
Found a bug though. It seems that the "Number of towns" and "Number of industries" input refuses to register the changes made to them (whatever you chose in the dropdown it stays the same). All other inputs work as intended. New version will probably be out tomorrow to fix this.
Found a bug though. It seems that the "Number of towns" and "Number of industries" input refuses to register the changes made to them (whatever you chose in the dropdown it stays the same). All other inputs work as intended. New version will probably be out tomorrow to fix this.
Re: Patch: New game in-game
Solved the problem with the fields that couldn't be edited. See first post for new patch.
Re: Patch: New game in-game
neat idea!
Re: Patch: New game in-game
You don't need any patches. Just tweak the settings once, before you start a game, they will be saved. All you have to do to restart a game is quit to the main menu and click "New game"->"Generate" - that's all, less then 2 seconds.
don't worry, be happy and checkout my patches
Re: Patch: New game in-game
adf88 wrote:You don't need any patches. Just tweak the settings once, before you start a game, they will be saved. All you have to do to restart a game is quit to the main menu and click "New game"->"Generate" - that's all, less then 2 seconds.
For that you can also open the console and type newgame and press enter. So if you are quick on the keyboard, this is faster and more convinient.
My OpenTTD contributions (AIs, Game Scripts, patches, OpenTTD Auto Updater, and some sprites)
Junctioneer (a traffic intersection simulator)
Junctioneer (a traffic intersection simulator)
Re: Patch: New game in-game
Well adf88, the whole point was that I'm to lazy to go back to the main menu. And I'd like to change the settings between maps .
Since no one have reported any problem with this patch I'll switch to my next patch idea, also one for those as lazy as me. It will be a "Play current scenario" sub-menu choice that will launch the current scenario from the scenario editor as a game. It's a bit trickier than the new game in-game patch so don't hold your breath...
Since no one have reported any problem with this patch I'll switch to my next patch idea, also one for those as lazy as me. It will be a "Play current scenario" sub-menu choice that will launch the current scenario from the scenario editor as a game. It's a bit trickier than the new game in-game patch so don't hold your breath...
Re: Patch: New game in-game
I have a few suggestions :
- After creating a new game, let the "new game" window opened for 20 seconds. So you can recreate many new games on the fly without reopening the window.
- Display the new game with the same zoom level as before creating the new game.
- If the minimap was open before creating a new game, re-open it.
With those evolutions, I think your patch would be very usefull and really user-friendly.
- After creating a new game, let the "new game" window opened for 20 seconds. So you can recreate many new games on the fly without reopening the window.
- Display the new game with the same zoom level as before creating the new game.
- If the minimap was open before creating a new game, re-open it.
With those evolutions, I think your patch would be very usefull and really user-friendly.
Who is online
Users browsing this forum: Semrush [Bot] and 6 guests