[Game] Archmage Gray

Post gaming related scripts
User avatar
Gio
Posts: 1247
Joined: 30 Sep 2013, 10:54
Location: Brazil

[Game] Archmage Gray

24 Mar 2019, 21:03

Hello There :wave:

A few months ago i decided to try and take on a new programming challenge: to code a full fledged AutoHotkey game. This turned out to be a great learning experience and i am now proud to share the results of my little experiment: Archmage Gray, a fantasy style shooter game completely animated with the aid of Tics GDI+ library.

>>Story<<


The game is set on the distant kingdom of Scriptia, where an old scholar wizard that has mastered all kinds of fungus and their magical properties, receives a letter by the king, asking for his help to defend the main city from an incoming horde of magical creatures led by an evil wizard.

ScreenShot1.png
ScreenShot1.png (475.97 KiB) Viewed 6338 times

On his way to confront the wizard, the player must find the fabled lexikos: these are the words of the many incantations that can draw powerful magic into this world.

ScreenShot2.png
ScreenShot2.png (561.19 KiB) Viewed 6338 times

Success in the game will require a lot of coordination in controling the wizard to avoid obstacles, keeping a distance from the monsters at all times, aiming and shooting at them until they subdue, and managing of the power of the lexikos that he/she manages to collected.

ScreenShot3.png
ScreenShot3.png (555.34 KiB) Viewed 6338 times

>>Controls<<

Instructions1.png
Instructions1.png (372.41 KiB) Viewed 11602 times
WASD moves the player, clicking anywhere will shoot in that direction. Hotkeys 1 to 5 will select a collected lexiko scroll, and hiting the spacebar will activate the selected scroll for multiple possible powers (teleport, beam, recover, freeze enemies or speed boost).

>>DOWNLOAD LINK (Source included)<<



This game is also a tribute to AutoHotkey, it's developers, and the AutoHotkey community. I am very thankful for having come across this community 7+ years ago :D

Do let me know what you thought of this game if you play it :thumbup:

NEW VERSIONS AND UPDATE INFO:
Version 1.02 (made available 26/12/2020):
Spoiler

Version 1.01 (made available 26/07/2019):
Spoiler
swagfag
Posts: 6222
Joined: 11 Jan 2017, 17:59

Re: [Game] Archmage Gray

24 Mar 2019, 22:49

are u lowkey tryin to entice lexikos to get back to coding lol
User avatar
Gio
Posts: 1247
Joined: 30 Sep 2013, 10:54
Location: Brazil

Re: [Game] Archmage Gray

25 Mar 2019, 08:57

No. I have started development for Archmage Gray in October 2018, following a personal growth in my interest about games that begun around september.
swagfag
Posts: 6222
Joined: 11 Jan 2017, 17:59

Re: [Game] Archmage Gray

25 Mar 2019, 13:20

relax mr seriousman. it was a joke

dont take it as disparagement towards u, ur project or whomever
User avatar
SpeedMaster
Posts: 494
Joined: 12 Nov 2016, 16:09

Re: [Game] Archmage Gray

26 Mar 2019, 06:39

This game is very beautiful and playable. :shock:
:shh: I tried to hack it into a space shoot'em up... but I failed miserably. :mrgreen:
Thanks for sharing. 8-) :thumbup:
User avatar
Gio
Posts: 1247
Joined: 30 Sep 2013, 10:54
Location: Brazil

Re: [Game] Archmage Gray

26 Mar 2019, 09:56

Thanks for the input SpeedMaster :)

Now that you mention it, changing it to a space theme should indeed be doable, and would perhaps require minimal changes to the code (most of the work would be on the sprites and sounds actually). On a quick thought, this is what i would do:

1. Change the background image (512x512) to a completely black image.
2. Change (or add) some of the artifacts to resemble distant clusters of stars, nebulas or galaxies.
3. Change the archmage sprites to those of a ship.
4. Change non-colisionable objects to resemble single distant stars.
5. Change colisionable objects to resemble asteroids (or remove them altogether if this doesn't fit in).
6. Change the enemy sprites to various types of alien ship sprites.
7. Change dead sprites to those of exploding ships, and instead of drawing them to the background graphics (G2, which is static), draw them to the refreshing graphics (G).
8. Change some of the sounds to resemble explosions or other sounds desired. The theme should also perhaps be electronic music (or may something more sci-fi-esque).
9. Add a SetTimer to increment Current_Y by 1 every ~80 miliseconds (so the ship never seems static).

Also, it may be possible to change Player.PosY to a higher number (some value around 450 in example) to make the character stand on a lower posion on the screen, but i think i have hard-coded the Player.PosY numeric value (which is 238) or some values close to it in some places in the script. This may affect colisions if only Player.PosY is changed and these are not updated, so there may be more work to do in this case.
DRocks
Posts: 565
Joined: 08 May 2018, 10:20

Re: [Game] Archmage Gray

26 Mar 2019, 10:43

what the heck! congrats, good job!!
User avatar
Gio
Posts: 1247
Joined: 30 Sep 2013, 10:54
Location: Brazil

Re: [Game] Archmage Gray

27 Mar 2019, 10:22

Thanks man :D

On another note:

>>Performance<<


In case anyone is interested in the performance side, i did a test in the compiled version of the game (while shooting repeatedly) and the resource usage (CPU and RAM) was this (from the task manager):
Resources.png
(421.61 KiB) Downloaded 262 times
Test was done on my notebook, an I3 3110M (An entry-level Dual-Core processor from 2012) with 4GB RAM running Windows 8.1.

:arrow: My thoughts: I am pretty satisfied with the results. People have stated in the past that games could not be written in AutoHotkey because "it wasn't fast enougth", but this game is actually below 10% CPU usage on a 7 year old entry-level notebook processor. Also, i did little to no optimization on the code, so there is probably room for A LOT of improvement on the performance side.

The 160MB memory usage is also justified: The file assets for the game (sounds and sprites) ammount to 30MB, but some assets are PNG files that are actually being converted to BMPs (size increases a lot) and loaded as many as 70x (The scenario is basically 70x the background image). This means that, if needed, i could actually do something like loading the scenario 10 backgrounds a time (or even 5) to greatly reduce memory usage (while increasing some CPU usage, of course).

In other words: if you wish to make a game in AutoHotkey as a personal project (an indie): just go ahead and do. :thumbup:
DRocks
Posts: 565
Joined: 08 May 2018, 10:20

Re: [Game] Archmage Gray

27 Mar 2019, 11:29

Haha this is very fun. Reminds me of the first runescape classic design.

Really good.

I immediatly thought, man this could have loots when monsters die and basic XP system. Using shift to sprint :D

Sadly I'm so busy these days but I am also a music producer so it would be fun to try sharing some sounds or music for you to choose what u prefer :D
User avatar
jeeswg
Posts: 6902
Joined: 19 Dec 2016, 01:58
Location: UK

Re: [Game] Archmage Gray

27 Mar 2019, 16:34

Epic. Thanks for sharing. Btw how did you do the images/music/sounds? Cheers.
homepage | tutorials | wish list | fun threads | donate
WARNING: copy your posts/messages before hitting Submit as you may lose them due to CAPTCHA
User avatar
Gio
Posts: 1247
Joined: 30 Sep 2013, 10:54
Location: Brazil

Re: [Game] Archmage Gray

27 Mar 2019, 18:58

@DRocks

Nice, i actually did played runescape many years ago. But for this game i was more inspired by ROTMG, which is also a MMORPG (unlike Archmage Gray).

It wouldn't be any hard to code an item drop system at this moment i think, since i have already coded an item class (so it's only a mater of creating an item as soon as a monster dies at the same XY coordinates that he was when he died). That being said though, i think the game currently lacks a suitable variety of items for that purpose. Maybe an enemy would drop a small life pack, but that would be a problem though since it would hinder the usefulness of lexiko 3 (recover) and also make the game much easier, given how short the run actually is (20 mins without major errors and you can beat the game now). What if the enemy drops some sort of coin that is used only as a point system (mario style :lol:)?

The sprint mechanic actually already exists through lexiko 5 (speed boost). Due to the nature of how it affects the dificulty level though, i decided to keep it as a trade off among other possible powers. A possibility then would be to lower the player speed to 3 and have it become 6 only while the shift is pressed (and 9 when speed boost is activated?), but this would make it quite harder to control the character for no apparent reason (i mean, either the player would probably hold the shift down at all times given the benefits of it, which would just result in worse gameplay controls OR i would have to also add some "tireness counter" mechanic, but this would really make the whole gameplay mechanic too complex (i.e.: the player having to control the speed boost counter AND the sprint tireness counter while moving at the same time)).

Also, thanks for the offer on sound the assets, i truly appreciate :D. If i find the time to update this project or make a new one, i may send you a message :thumbup:

@Jeeswg
Btw how did you do the images/music/sounds?
The full answer to that question is quite complex actually. The simple answer though is this:

1. I drew most of the 140+ sprites from scratch using paint.NET after watching tutorials on youtube and getting inspiration from existing images.
2. I also edited and used a few (3 or so) images that were available online and explicitly sported public-domain-like licenses (specially for the menu backgrounds).
3. For the sounds, all 14 of them were obtained online from sources that explicitly sported public-domain-like licenses and were also edited by me (mostly i just cut parts of them and increased/decreased volume using Audacity).

The process of creating or collecting the assets is quite labourious and it took a considerable portion of the development time for the game, but curiously it is also quite a pleasing one :thumbup:
DRocks
Posts: 565
Joined: 08 May 2018, 10:20

Re: [Game] Archmage Gray

27 Mar 2019, 19:22

@Gio

Thanks for the complete reply.
- I must agree with what you say about the shift control now that I understand the lexikos that I did not get while playing. I only had 1 and 3 to try yet.

- For items it could be somethings like potions that could maybe change the spell width and or color so that it helps you aim better or hits a bit harder than the default.
Or another idea, just a XP system / kill counter to give the impression of progressing and getting stronger.
(PS I looked a tthe code and I understand its hard work so these are just ideas from my dreamy head)

- And for the sounds, I was too happy to test your game and did a sample ArchMageTheme when got back from work tonight.
Here you can try placing this in the folder instead of intro just to see if you like the general mood :D
Its made from sratch and I am legal owner so you can use it freely I give it to you
OneDrive link
https://1drv.ms/u/s!AnxboyZ6ZdpRhKdplL1H5Zot8kCrEQ


Edit: maybe just as you said, a coin/xp counter would be perfect. You could succeed or fail and see what was your score :D
It could be visible on the Frame Gui while you play.

Edit again: Sorry about my multiple edits, i'm thinking while playing the game and gradually having ideas.. lol
I noticed that this part is crucial to the refresh rate of the images

Code: Select all

SetTimer, DrawScene, 20 ; This can limit the max FPS if needed. Around 20 FPS atm (50 ms intervals between drawings).
I am asking myself, what if that setTimer would be VERY low like 10-20 ms only so that the image as no stutter/flicker. But then lower all player/ennemies movements so that it doesn't actually play faster but just more fluid images ?

Edit 3: I have found a easy way where score could be counted.

Code: Select all

			If (Hit_Type = 1) ; Spiky Fungus Hit
			{
				Enemy_%A_Index%.Current_Hitpoints := Enemy_%A_Index%.Current_Hitpoints - 10
				Score += 10
			}
			Else if (Hit_Type = 2) ; Beam Hit
			{
				Enemy_%A_Index%.Current_Hitpoints := Enemy_%A_Index%.Current_Hitpoints - 100
				Score += 100
			}
			Tooltip, % "Score: " Score
Last edited by DRocks on 27 Mar 2019, 20:38, edited 1 time in total.
User avatar
jeeswg
Posts: 6902
Joined: 19 Dec 2016, 01:58
Location: UK

Re: [Game] Archmage Gray

27 Mar 2019, 20:32

Re. speed, I noticed the higher up the map, the slower it got. So something was accumulating I suppose.
homepage | tutorials | wish list | fun threads | donate
WARNING: copy your posts/messages before hitting Submit as you may lose them due to CAPTCHA
User avatar
Gio
Posts: 1247
Joined: 30 Sep 2013, 10:54
Location: Brazil

Re: [Game] Archmage Gray

27 Mar 2019, 21:47

@DRocks,

Your music is very nice, thanks for sharing it :D

I find it to somehow have a pinch of melancholy. Curiously, during development i did considered for a long time using a theme i considered more melancholic than the one in v1-0. It somehow fits better with the Intro and the Story of the old reclusive mage. In the end though, i dropped that theme due to the licensing choice of the author (cc3) and the fact that i found the gameplay to require something that would bring a little bit more energy (since the gameplay is somewhat fast-paced). The final intro choice for v1-0 thus ended up being both one that i find a little melancholic and also a little motivational. Since the option did arise though, i would say yours might be a great addition to the intro and story scene (with maybe some black screen silence time in between when the player clicks the intro option, so as to not cause an imediate switch between the two musics).
- For items it could be somethings like potions that could maybe change the spell width and or color so that it helps you aim better or hits a bit harder than the default.
Or another idea, just a XP system / kill counter to give the impression of progressing and getting stronger.
(PS I looked a tthe code and I understand its hard work so these are just ideas from my dreamy head)
The potion thing is quite a good idea. I am not entirely sure how i would implement "aim better" (except if the missile were to automatically aim the enemy despite the player clicking elsewhere), but the spell width adjustment seems to be pretty easy to do.

Edit: I actually misunderstood width for time. Yes, chaging the colision area of the missile based on an effect being present is indeed easy to do and would really make aiming easier. Changing the spell effect time of lexiko scrolls 4 (freeze enemies) and 5 (speed boost) based on a potion and a timer as mentioned, is also doable too.
I noticed that this part is crucial to the refresh rate of the images
I am asking myself, what if that setTimer would be VERY low like 10-20 ms only so that the image as no stutter/flicker. But then lower all player/ennemies movements so that it doesn't actually play faster but just more fluid images ?
You are absolutely right there. I actually came to the that conclusion when i was nearing v1-0 :lol:
Drawing and calculating all interactions should not be done at the same time intervals (i.e., a single routine for both, as is in the current code). This simplification comes at a cost of being unable to achieve higher FPS without affecting gameplay.
I have found a easy way where score could be counted
I really don't think a beam (lexiko 2) hit should count 10x more score (unless you are using the HP of the enemies as a direct 1:1 score indicator). Other than that, you actually found the right place in the code that accounts for succesful hits.

@Jeeswg:
Re. speed, I noticed the higher up the map, the slower it got. So something was accumulating I suppose.
I didn't quite noticed speed being changed the more you move up in the scenary. I did noticed however, that when you shoot many times in quick sucession near lots of trees and enemies, it may indeed affect maximum FPS (the FPS is currently capped by the SetTimer of the DrawScene routine, so in most PCs it is not noticeable). This can be a greater problem on older computers. And curisouly, even though CPU usage on my notebook does increase in such cases, it never really goes too high (so in theory, there should not be a FPS drop, just a higher CPU usage?). I am still looking into this.

Also, there is one thing that i did noticed accumulates the more you move up: memory usage. It begins around 160MB, but can go higher than 200MB before you reach the end of the game. I have also not found the cause of this memory leak yet (unless its from the attack objects, which currently do accumulate over time. And if this is the case, it may also explain the drop in speed you are noticing, since drawattacks() function loops through all existing attack objects, including inactive ones, which are then filtered by a subsequent conditional).
DRocks
Posts: 565
Joined: 08 May 2018, 10:20

Re: [Game] Archmage Gray

28 Mar 2019, 06:07

@Gio
Since the option did arise though, i would say yours might be a great addition to the intro and story scene (with maybe some black screen silence time in between when the player clicks the intro option, so as to not cause an imediate switch between the two musics).
Thanks for your kind words on the music.
Yes why not. You know I could make almost anything you want. All I would need to know is your exact timings so that I can cut / fade the .wav files perfectly with what you need. Also if you keep the original intro, please do provide me with the original file because this is really distorting and makes it less enjoyable. I could make it as loud as you wanted it without any clipping / distortion sound. I think it is important since you hear it for the whole time playing.
On another hand, I have noticed that the intro is basically being looped by a SetTimer that repeats at the exact end point of the .wav file right ? Why not add different paced music when entering higher level stages like I've seen in your code when monsters beging to be harder etc. It would be easy to have other set timers that trigger another song or a different part of the same theme.

Just let me know if you are interested in this kind of music design. Honestly I like your project and I'd be glad to provide my help with sounds. All I need is to know what you need and I can use my spare time to get you that for free with no licence or anything. :bravo:

Finally, because we've been talking about score and agreed on a place in the script where it could be calculated. What do you think of adding this score count at a proper place on the frame GUI ? And why not save your score to a .ini file at the simplest to compare your successes etc ?
Let me show you a visual representation of whats on my mind when I'm talking about this:
Image

Again, all these are ideas, this is your game :D
User avatar
Gio
Posts: 1247
Joined: 30 Sep 2013, 10:54
Location: Brazil

Re: [Game] Archmage Gray

28 Mar 2019, 09:12

please do provide me with the original file
Sure, you can download it here. I am not sure what you meant by distortion though, perhaps it is because the sound was not software synthesized? All i did for v1-0 was remove some of the loops in the song and increase/decrease the volume. The waves in the loops of the original file are different by themselves (as if it was a recording?).
I have noticed that the intro is basically being looped by a SetTimer that repeats at the exact end point of the .wav file right ? Why not add different paced music when entering higher level stages like I've seen in your code when monsters beging to be harder etc. It would be easy to have other set timers that trigger another song or a different part of the same theme.
Finally, because we've been talking about score and agreed on a place in the script where it could be calculated. What do you think of adding this score count at a proper place on the frame GUI ? And why not save your score to a .ini file at the simplest to compare your successes etc ?
Those are good ideas. Both the music differentiation later on and the score display. If the game were longer, they would probably be an absolute must. At this moment, it is a very valid improvement though, but do keep in mind how short the game actually is. Levels and XP, i am not so sure, they really don't seem to come hand-to-hand with a 20 minute run game :lol:

Have you beaten the game already btw? It does have an evil wizard boss. A music change specifically for this boss encounter would be awesome (it can be triggered when Current_Y is over 35000). Something that adds suspense and increases alertness/energy in the player, but which doesn't deviate from a medieval-fantasy-like theme.

That being said, i can indeed see the game being easily converted to an endless running type of game, something to which a score and/or level system could really apply much better. At the moment, scenario and enemies are already being proceduraly generated, so it would only be a mater of creating second/third/fourth... levels with increased dificulty (more monsters, faster monsters, more hp, etc). The main goal would shift to a higher-score-possible goal though, which would not be on-par with the current story-telling side of the game. It could be a secondary game-mode though.
DRocks
Posts: 565
Joined: 08 May 2018, 10:20

Re: [Game] Archmage Gray

28 Mar 2019, 09:25

Gio wrote:
28 Mar 2019, 09:12
they really don't seem to come hand-to-hand with a 20 minute run game
Well that's exactly the point. I mean that from game to game it could collect your global XP and give you the sense of progressing and maybe even make your player 1 value higher for speed lets say every 5 levels and/or +5 hp per levels, for example.
Imagin saving each game at the game over or success at the end of ebating the wizard. You could save player Game Score which adds up to their total XP. Ex: Previous XP 2000 + GameScore (2300 XP) = New Total XP to save to File.
I think this way would make the 20 minute game have a endless goal just by that simply add-on and as you said it can have other scenarios etc.
haha sorry about my excess of imagination :dance:

Edit: No I was not able to beat the wizard yet even when cheating lolll - I tried to give myselg 1000000 hp but i think it crashed the engine. Then I tried my player speed to 1000, was not a good idea. I also found your F3 hotkey to go direct to the boss haha

- I will see if the original downloaded file is already distorted or if it was due to increasing the volume too much in audacity. You have to be careful never exceeding 0 DBFS otherwise digital clipping occurs and sounds terrible. The solution to prevent this si to use a limiter on the output so that it is not digitally clipping. I can do that easy if the original file is not already corrupted with bad clipping. A limiter will allow you to crank the volume to almost unreasonnable levels before it starts to sound BADLY clipping. Its a must tool when maximizing volume of a file. *I'll get back to you on this
Edit: Okay, I can confirm that mistakenly you have cranked the volume above 0 DB haha :D I'll fix that for you and send it maximized without clipping you'll hear the difference
DRocks
Posts: 565
Joined: 08 May 2018, 10:20

Re: [Game] Archmage Gray

28 Mar 2019, 10:07

@Gio

Here is the original intro without clipping and with maximized volume. I also added a hint of reverb to make it sound a little more united and dreamy its subtle.
https://1drv.ms/u/s!AnxboyZ6ZdpRhKd5ayHROER9Z3tm_Q

I tried fading it in and out the best possible to make it loop endlessly without problems. But maybe the total time has changed a bit from your original cuts :)
EDIT: I can make it Louder if needed and adjust fades :)
User avatar
Gio
Posts: 1247
Joined: 30 Sep 2013, 10:54
Location: Brazil

Re: [Game] Archmage Gray

28 Mar 2019, 11:08

Now that you mention a between-runs level system, i think it could apply. Doing some increase in HP or speed given the level of the player would make the game easier however. This could be a plus for those players which find the game too dificult at first (since they too would be able to beat the game with enougth patience). That being said, for those players whose dificulty level is already on-par with their skills, they would actually see a decrease in dificulty going alongside they becoming even better at the game, which could totally ruin the challenge.
No I was not able to beat the wizard yet even when cheating lolll - I tried to give myselg 1000000 hp but i think it crashed the engine. Then I tried my player speed to 1000, was not a good idea. I also found your F3 hotkey to go direct to the boss haha
The F3 hotkey was originally in place for testing purposes, but seeing that you found and uncommented it was a nice surprise :lol:
Setting the speed to 1000 will probably break the gameplay altogether as you would be unable to move without going past the visible area, and setting the hp to 1,000,000 is probably not going to work because of the drawhud() function attempting to draw 100,000 10hp sprites every frame. That being said, setting the player HP to 400 or something like that would probably work as a cheat.

Below are comments on my strategy for the evil wizard (it's spoiler, so don't look if you want to beat it alone)
Spoiler
Here is the original intro without clipping and with maximized volume
Thanks, i will take a look at it :thumbup:

Return to “Gaming Scripts (v1)”

Who is online

Users browsing this forum: No registered users and 32 guests