Background power v1.30 (I made a incremental game with autohotkey.)

Post your working scripts, libraries and tools for AHK v1.1 and older
Mipha
Posts: 77
Joined: 27 Jul 2018, 17:08

Background power v1.30 (I made a incremental game with autohotkey.)

28 Sep 2018, 06:48

I made an actual game with autohotkey. The goal right now is just to make the main resource (power) go up but there's a couple interesting mechanics.

But first Here is a link to a download of the game. If you get an error. Then your ahk version may be outdated (please tell me your ahk version if this happens because I've heard people saying that they did not encounter the version detection system telling them their ahk version is outdated.

And here is the full code. Warning, lot of code https://pastebin.com/UJtYKLnX

There is no idle progress. If you do nothing. The game does nothing other than autosaving and such.

Power is gained when clicking the mouse anywhere on your screen so you don't need to have the game selected. Some other methods of power become available after some time as well like moving the mouse.

So this game does in fact track the mouse anywhere which may sound suspicious in the eyes of many people. I have no intentions of doing anything malicious like saving people's passwords but you can easily check the code of the game and guarantee it for yourself.

look for the help tab to gain some info about how the game works. New entries get added as you make some progress through the game.

The game is currently in a very early but playable state. I havent really looked into how expensive the costs would be in the lategame so getting max levels of all upgrades might be impossible though the garden should give a solid edge to your production when optimized well.

The main reason I am posting this here is because I want people to take a look at the project and give me advice on what I should do to make it better. Espacially on how to make the code better So please leave feedback if you've got something to say about it.

Changelog

V1.30
  1. Changed the layout of the entire game. All menus are now combined. Also changed the visuals of everything. I hope it looks good
  2. added autoclick prevention.... Don't worry however because its an option you can turn on to disable power gain from clicking when clicking really fast.
  3. The garden and the shop now show their info in a tooltip instead of in the menu itself
  4. Garden plant spawn rate reduced
  5. Garden plants now spawn with their own background and text color.
  6. added protect feature to the garden to prevent accidentally harvesting plants
  7. Added a new feature. Keyboard keys. Its the simpler version of hidden keys that works on any keyboard key and once every second
  8. Talking about hidden keys. The feature has been renamed to golden keys
  9. Added a new feature. Almanac. This replaces the old garden knowledge system and gives more info about plants.
  10. due to the old knowledge system being removed, everyone gains 2 knowledge points for every revealed recipe they had
  11. added 4 new plants to help knowledge harvesting including a rather powerful one.
  12. added a couple other plants as well and changed many plant names, descriptions, stats etc. Early obtainable plants are also a bit more powerful and every plant is harvested for more power
  13. Reworked the radar. Instead of 2 dots it now shows 1 dot which changes shapes when you get near a hidden treasure
  14. saying the word garden one more time (I will start working on other features soon.)
  15. Added some new upgrades
v1.31
  1. Garden plants now show their base power gain when harvested (without other things affecting it)
  2. fixed the help tag telling that amulets boost clicking power gain by *0
v1.32
  1. Changed the colors of the amalgam plant
  2. Creating an amalgam plant using 2 protected plant now doesnt create a double protected plant
  3. Fixed display bug in the almanac
v1.33
  1. Text size now differs depending on the size of the game window to prevent buttons being cut off the end of the screen
  2. Added a message that shows when people have an outdated ahk version and tells them that.
v1.44
  1. Amalgam plants now take on the color of a random plant that gets fused (symbol remains the same)
  2. Amalgam plants now dont target plants with fusion abillities anymore
Last edited by Mipha on 14 Oct 2018, 16:38, edited 20 times in total.
User avatar
TheDewd
Posts: 1507
Joined: 19 Dec 2013, 11:16
Location: USA

Re: I made an incremental game using autohotkey

28 Sep 2018, 07:53

Some of your code is corrupted? The first # character in #NoEnv is not correct. It's very difficult to see unless you zoom in on the character in Notepad++ or similar. It has a little dot between the top lines.

After correcting that, the script is giving an error that the Min() function can not be found.

Very interested in your game. Can't wait to see what you've done with 3000 lines of code.
Mipha
Posts: 77
Joined: 27 Jul 2018, 17:08

Re: I made an incremental game using autohotkey

28 Sep 2018, 07:57

TheDewd wrote:Some of your code is corrupted? The first # character in #NoEnv is not correct. It's very difficult to see unless you zoom in on the character in Notepad++ or similar. It has a little dot between the top lines.
I'm not entirely sure what you mean with this. Does this prevent you from launching the game or does it just look different. Me and others haven't had this problem before.
TheDewd wrote: After correcting that, the script is giving an error that the Min() function can not be found.
Ah yes, many others seem to have had this problem as well and it is fixed by getting a newer version of autohotkey. (I should probably put something in the game eventually to remind people this)
User avatar
TheDewd
Posts: 1507
Joined: 19 Dec 2013, 11:16
Location: USA

Re: I made an incremental game using autohotkey

28 Sep 2018, 08:10

Mipha wrote:I'm not entirely sure what you mean with this. Does this prevent you from launching the game or does it just look different. Me and others haven't had this problem before.
It only occurs when I manually copy/paste the code from DropBox. Using the Download button saves the game correctly without issue.
Mipha wrote:Ah yes, many others seem to have had this problem as well and it is fixed by getting a newer version of autohotkey. (I should probably put something in the game eventually to remind people this)
You mentioned this in the initial post, but I must have missed it. It's my fault entirely. Sorry for any inconvenience.

I will look at the game to see if I can provide any suggestions and feedback. :D
SOTE
Posts: 1426
Joined: 15 Jun 2015, 06:21

Re: I made an incremental game using autohotkey

28 Sep 2018, 11:33

Mipha wrote:I made an actual game with autohotkey. The goal right now is just to make the main resource (power) go up but there's a couple interesting mechanics.

But first Here is a link to a download of the game. If you get an error. Then your ahk version may be outdated

There is no idle progress. If you do nothing. The game does nothing other than autosaving and such.

Power is gained when clicking the mouse anywhere on your screen so you don't need to have the game selected. Some other methods of power become available after some time as well like moving the mouse.

So this game does in fact track the mouse anywhere which may sound suspicious in the eyes of many people. I have no intentions of doing anything malicious like saving people's passwords but you can easily check the code of the game itself and guarantee it for yourself.

look for the help tab to gain some info about how the game works. New entries get added as you make some progress through the game.

The game is currently in a very early but playable state. I havent really looked into how expensive the costs would be in the lategame so getting max levels of all upgrades might be impossible though the garden should give a solid edge to your production when optimized well.

The main reason I am posting this here is because I want people to take a look at the project and give me advice on what I should do to make it better. Espacially on how to make the code better So please leave feedback if you've got something to say about it.
You could also post your code on this forum, using the code option, not just on Dropbox. And there is Pastebin too, https://pastebin.com/ Those options are helpful to those that like to manually copy and paste code.
Mipha
Posts: 77
Joined: 27 Jul 2018, 17:08

Re: I made an incremental game using autohotkey

28 Sep 2018, 12:01

SOTE wrote: You could also post your code on this forum, using the code option, not just on Dropbox. And there is Pastebin too, https://pastebin.com/ Those options are helpful to those that like to manually copy and paste code.
I've added the full code in the post. How important is adding the pastebin link too?
User avatar
TheDewd
Posts: 1507
Joined: 19 Dec 2013, 11:16
Location: USA

Re: I made an incremental game using autohotkey

28 Sep 2018, 12:07

Mipha wrote:How important is adding the pastebin link too?
If you've already posted the code in your post you don't need an additional link to pastebin too. I think the post is fine now. :)
SOTE
Posts: 1426
Joined: 15 Jun 2015, 06:21

Re: I made an incremental game using autohotkey

28 Sep 2018, 12:15

Mipha wrote:
SOTE wrote: You could also post your code on this forum, using the code option, not just on Dropbox. And there is Pastebin too, https://pastebin.com/ Those options are helpful to those that like to manually copy and paste code.
I've added the full code in the post. How important is adding the pastebin link too?
It's up to you, and either would be fine. Just a matter of preference.
Mipha
Posts: 77
Joined: 27 Jul 2018, 17:08

Re: I made an incremental game using autohotkey

29 Sep 2018, 10:49

Added a new version. Changed a lot of stuff so I sincerely hope nothing breaks in the end.

Note that the saves of old versions should be compatible with new ones.
Mipha
Posts: 77
Joined: 27 Jul 2018, 17:08

Re: I made an incremental game using autohotkey

01 Oct 2018, 17:35

TheDewd wrote: If you've already posted the code in your post you don't need an additional link to pastebin too. I think the post is fine now. :)
Sorry if I'm bothering you with this but its been a few days and so far people really haven't given me a lot of feedback. I would really like to know from you (or other people) what I can and should do to improve this game.
User avatar
SpeedMaster
Posts: 494
Joined: 12 Nov 2016, 16:09

Re: I made an incremental game using autohotkey

02 Oct 2018, 03:22

your code wrote:A rich energetic sap oozes from this plant to the neighboring tiles
I don't see any tiles in this game. Or maybe I missed something. :think:
You have a lot of imagination, which is a good point for role-playing games. :thumbup:
You should consider making ascii roguelike games. I made one some time ago (hard to solve secret passages and traps).
Maybe this can inspire you to add some visuals to your game.
https://autohotkey.com//boards/viewtopi ... 19&t=43403

the game comes with a tutorial on how to make ascii role plaing games.
"Beginner’s Guide to Roguelikes in C/C++" by Craig Stickel
https://web.archive.org/web/20130305014 ... index.html


Cheers
Mipha
Posts: 77
Joined: 27 Jul 2018, 17:08

Re: I made an incremental game using autohotkey

02 Oct 2018, 06:19

SpeedMaster wrote:
your code wrote:A rich energetic sap oozes from this plant to the neighboring tiles
I don't see any tiles in this game. Or maybe I missed something. :think:
You have a lot of imagination, which is a good point for role-playing games. :thumbup:
You should consider making ascii roguelike games. I made one some time ago (hard to solve secret passages and traps).
Maybe this can inspire you to add some visuals to your game.
https://autohotkey.com//boards/viewtopi ... 19&t=43403

the game comes with a tutorial on how to make ascii role plaing games.
"Beginner’s Guide to Roguelikes in C/C++" by Craig Stickel
https://web.archive.org/web/20130305014 ... index.html


Cheers
Thanks. I'll definetely take a look at this guide because I get the feeling that showing plants as a picture instead of a word should look way better.
The roguelike tutorial might also be of use because I am actually planning to include a dungeon system in my game controlled by the arrow/wasd keys.
A rich energetic sap oozes from this plant to the neighboring tiles
When you purchase the garden. You can buy garden tiles for plants to appear in. This plant affects tiles next to it with both a passive and permanent effect. This is how the garden looks with 100 tiles and the plant in question. I currently started reworking most visuals and link all the menus together.
Asmodeus
Posts: 57
Joined: 19 Oct 2015, 15:53

Re: I made an incremental game using autohotkey

02 Oct 2018, 13:58

uploaded an in game screenshot, in case s.o. is wondering how it might look like :roll:
Image
Mipha
Posts: 77
Joined: 27 Jul 2018, 17:08

Re: I made an incremental game using autohotkey

02 Oct 2018, 16:11

Asmodeus wrote:uploaded an in game screenshot, in case s.o. is wondering how it might look like :roll:
Good idea.. I should probably post some of those too.
Image Image Image

As a sidenote. I'm currently working on a version that combines all the menus together. This is what it looks right now (layout may change)
Image
User avatar
SpeedMaster
Posts: 494
Joined: 12 Nov 2016, 16:09

Re: I made an incremental game using autohotkey

02 Oct 2018, 17:15

Mipha wrote:give me advice on what I should do to make it better. Espacially on how to make the code better
With more than 3000 lines of code, you probably have more experience in role-playing and programming than I do. I would like to have such knowledge :cry: .
I think it's time for you to move forward and learn object-oriented programming. Don't just stay in procedural programming.
I know it's easier said than done, I myself am only a beginner in this field. :lol:
There are more advantages in manipulating classes in your case and you can get help if you have a specific question. :!:

Here is my newbie example ( Sorry experts if I made syntax errors or blasphemies :mrgreen: )

Code: Select all

#SingleInstance force

class plant {
	rarity:= 100
	descr:= "this is a plant"
	name:= "plant"
}

myplants:="pumpkin,yellowberry"

for key, val in strsplit(myplants, "`,") 
	%val%:=new plant, %val%.name:=val

pumpkin.descr     := "Spoopy"
yellowberry.descr := "Yellow berries don't do anything special but are great at creating new and exciting plants"

msgbox, % "pumpkin descr is : " pumpkin.descr . "`n"
.  "pumpkin name is : " pumpkin.name . "`n"
.  "pumpkin raity is : " pumpkin.rarity . "`n"
.  "yellowberry raity is : " yellowberry.rarity . "`n"
.  "yellowberry name is : " yellowberry.name . "`n"
.  "yellowberry descr is : " yellowberry.descr

return
guiclose: 
esc:: 
exitapp 
return

Translated with http://www.DeepL.com/Translator
Mipha
Posts: 77
Joined: 27 Jul 2018, 17:08

Re: I made an incremental game using autohotkey

02 Oct 2018, 17:38

SpeedMaster wrote: Here is my newbie example ( Sorry experts if I made syntax errors or blasphemies :mrgreen: )

Code: Select all

#SingleInstance force

class plant {
	rarity:= 100
	descr:= "this is a plant"
	name:= "plant"
}

myplants:="pumpkin,yellowberry"

for key, val in strsplit(myplants, "`,") 
	%val%:=new plant, %val%.name:=val

pumpkin.descr     := "Spoopy"
yellowberry.descr := "Yellow berries don't do anything special but are great at creating new and exciting plants"

msgbox, % "pumpkin descr is : " pumpkin.descr . "`n"
.  "pumpkin name is : " pumpkin.name . "`n"
.  "pumpkin raity is : " pumpkin.rarity . "`n"
.  "yellowberry raity is : " yellowberry.rarity . "`n"
.  "yellowberry name is : " yellowberry.name . "`n"
.  "yellowberry descr is : " yellowberry.descr

return
guiclose: 
esc:: 
exitapp 
return

Translated with http://www.DeepL.com/Translator
That actually looks quite useful. Thanks and I will look into it. However I'm not entirely sure how useful it will be in the garden since the eldervine exists. And eldervine creates a copy of 2 different plants meaning there's many variations of the resulting plant so amalgamplant.name would not work (If I understand this correctly)
User avatar
SpeedMaster
Posts: 494
Joined: 12 Nov 2016, 16:09

Re: I made an incremental game using autohotkey

03 Oct 2018, 02:33

Mipha wrote:I'm not entirely sure how useful it will be in the garden since the eldervine exists. And eldervine creates a copy of 2 different plants meaning there's many variations of the resulting plant so amalgamplant.name would not work (If I understand this correctly)
that's exactly why object-oriented programming is so useful in role-playing games. :thumbup:
This allows you to make all kinds of strange combinations or new behaviors. :D
and a class can also have its own set of functions called methods
If you have a problem, try to reproduce your problem in a small script and ask a question.

here is an interesting article:
https://medium.com/@franksands/why-is-o ... 0e2d1c5505

Code: Select all

#SingleInstance force

class plant {
	rarity:= 100
	descr:= "this is a plant"
	name:= "plant"
	harvest:={harvestpower:55}
	global:={clickpower:2, movepower:6, movespeed:1, movepowerpercent:1, clickpowerpercent:1}
	auras:={global:{clickpower:1}, passive:{harvestpower:1, harvestpowerpercent:5}}
	tileauras:={passive:{harvestpower:10}}
	fusion:={strength:1, amount:2, name:"amalgam plant", descr:"Turns out fusing plants doesn't combine the appeal of them."}
}

myplants:="pumpkin,yellowberry"

for key, val in strsplit(myplants, "`,") 
	%val%:=new plant, %val%.name:=val

pumpkin.descr     := "Spoopy"
yellowberry.descr := "Yellow berries don't do anything special but are great at creating new and exciting plants"

pumpkin.fusion.amount:=1888
pumpkin.fusion.name:=pumpkin.name " and " yellowberry.name

msgbox, % "pumpkin descr is : " pumpkin.descr 							. "`n"
.  "pumpkin name is : " pumpkin.name 									. "`n"
.  "pumpkin raity is : " pumpkin.rarity 								. "`n"
.  "yellowberry raity is : " yellowberry.rarity				    		. "`n"
.  "yellowberry name is : " yellowberry.name 							. "`n"
.  "yellowberry descr is : " yellowberry.descr 							. "`n"
.  "yellowberry harvestpower is : " yellowberry.harvest.harvestpower 	. "`n"
.  "yellowberry global clickpower is : " yellowberry.global.clickpower 	. "`n"
.  "pumpkin fusion amount is : " pumpkin.fusion.amount 					. "`n"
.  "pumpkin fusion name is : " pumpkin.fusion.name 						. "`n"

return
guiclose: 
esc:: 
exitapp 
return
Cheers,
Mipha
Posts: 77
Joined: 27 Jul 2018, 17:08

Re: I made an incremental game using autohotkey

13 Oct 2018, 07:18

Its my birthday today. So I decided to release a new update. I really hope the game looks a lot better now.

Return to “Scripts and Functions (v1)”

Who is online

Users browsing this forum: gwarble and 110 guests