[DIY] making html5 wesnoth-themed roguelike

Discuss the development of other free/open-source games, as well as other games in general.

Moderator: Forum Moderators

Post Reply
Shadow_Walker
Posts: 80
Joined: July 27th, 2014, 4:34 pm

Re: [DIY] making html5 wesnoth-themed roguelike

Post by Shadow_Walker »

It is in alpha stage right now, game features are just being implemented. Beta status (eventually) will mean feature freeze, bug hunt, balance tuning, etc..

Yep, unused or incorrectly used spells are wasted. It is supposed to be a fast-paced game, forcing player to explore the area..

Oops, new page. Just to keep latest link on top - v0.83a is released at:
http://www.wessense.org/

features magic spells and monter-to-monster combat
optimother
Posts: 76
Joined: July 12th, 2014, 4:09 am

Re: [DIY] making html5 wesnoth-themed roguelike

Post by optimother »

It is supposed to be a fast-paced game, forcing player to explore the area..
Maybe you are right, but when I tested it didn't contribute to fun, but rather an annoyance. You can't tell exactly whether enemy is in range of the spell or not, so it's not a wrong decision which you made, from which you can learn better play, but rather a game flaw which just causes you to waste some time lurking again for another scroll.

Btw, about the passage of real time in game. Movements are instant, and it's not always obvious what happened, but attack animations take very loooong time, which feels inconsistent for me. I'd prefer faster attacks and animated movements (just sliding is ok, not necessary walking for now) just to keep track of what's happening easier.

Also if you attack strong unit and run from it to the terrain it can't walk, all you need to do is just clicking on it, which could be automated. Like walking several squares, so is attacking until kill, for example Shift+Click, or something?

upd. I had once a frozen game in the 'enemy move state'
User avatar
iceiceice
Developer
Posts: 1056
Joined: August 23rd, 2013, 2:10 am

Re: [DIY] making html5 wesnoth-themed roguelike

Post by iceiceice »

I took a look at this, I have to say the look and feel is remarkably polished -- good job. Just a comment, I guess that your interface is currently set up to use backspace as the "skip this turn" button? But as I learned the hard way, on chrome that appears to cause the browser to navigate back one page :( Maybe a more natural way to do this is have just clicking on your character cause it to skip a turn?
Shadow_Walker
Posts: 80
Joined: July 27th, 2014, 4:34 pm

Re: [DIY] making html5 wesnoth-themed roguelike

Post by Shadow_Walker »

iceiceice wrote:I took a look at this, I have to say the look and feel is remarkably polished -- good job. Just a comment, I guess that your interface is currently set up to use backspace as the "skip this turn" button? But as I learned the hard way, on chrome that appears to cause the browser to navigate back one page :( Maybe a more natural way to do this is have just clicking on your character cause it to skip a turn?
Click on the green box right under minimap - in the current version it should trigger "skip turn" action (notification text should appear). "Click on a player skips turn" - yep, this may also work, will implement it too. Thanks for the feedback!
Shadow_Walker
Posts: 80
Joined: July 27th, 2014, 4:34 pm

Re: [DIY] making html5 wesnoth-themed roguelike

Post by Shadow_Walker »

optimother wrote:upd. I had once a frozen game in the 'enemy move state'
Ha, I just got one too, but I cannot find the problem in my code. It is definitely an artefact of monster vs monster fight, but I just cannot reproduce it. I will be grateful to anyone who can provide a reproducible test, or even describe the conditions which may trigger it (like "I charmed wose, and it got killed by a goblin pack in the desert").
optimother
Posts: 76
Joined: July 12th, 2014, 4:09 am

Re: [DIY] making html5 wesnoth-themed roguelike

Post by optimother »

I've just stuck upon a hang up again.

It's hard to reproduce the bug which happens on random map after hundreds of moves :)

I'd suggest to move the next_monster_move() call from the insane if's tree in 'friendly' case to just before line 689, I think it's the source of problem.

What I did — spawned horde of mirrors and set out on Hydra in swamp (somewhere around x=253,y=219). This happened at night, I hoped it would be sleeping, so I can't see what's happening there. The log in the top of the window just reported that image killed on every turn, then it hang up.

Btw, if we a starting to stuck upon rare bugs, maybe it'd be good to record all user actions and map generation options, so that we could report it. Like hero = mage, seed = 0.636440517148003 (from my frozen game), monsters = hordes, difficulty = hard, other options at their default values. And then 1140 moves :))

Queueing with mMQ is clever, but it also is a hack, and seems fragile. When I experimented with game I used just stream of events instead of queue, so some actions could be done in parallel, because the game state is completely independent from animation.
Shadow_Walker
Posts: 80
Joined: July 27th, 2014, 4:34 pm

Re: [DIY] making html5 wesnoth-themed roguelike

Post by Shadow_Walker »

optimother wrote: What I did — spawned horde of mirrors and set out on Hydra in swamp (somewhere around x=253,y=219). This happened at night, I hoped it would be sleeping, so I can't see what's happening there. The log in the top of the window just reported that image killed on every turn, then it hang up.
Okay, this sounds like an off-screen animation issue to me..
optimother wrote: Btw, if we a starting to stuck upon rare bugs, maybe it'd be good to record all user actions and map generation options, so that we could report it. Like hero = mage, seed = 0.636440517148003 (from my frozen game), monsters = hordes, difficulty = hard, other options at their default values. And then 1140 moves :))
Great idea!
optimother wrote:Queueing with mMQ is clever, but it also is a hack, and seems fragile. When I experimented with game I used just stream of events instead of queue, so some actions could be done in parallel, because the game state is completely independent from animation.
Well, either it is a turn-based strategy, or real-time strategy. Turn-based one cannot have parallel combats - this destroys the idea of local "ordered" strategies, really. Click-click-click ( 202 clicks per second to make zerg rush ) = RTS, which I don't want to implement. This is supposed to be a fast game for a lunch time, with no pressing "clock is ticking, your opponent already produced zealots" feeling. Also, Javascript is a single-threaded browser-based language, no *real* parallel execution occurs no matter what kind of messaging/queuing is used. Asyncronous execution in JS is just asyncronous, it is not truly parallel at all,

I will add a configuration option to allow normal/fast/instant moves. But, if you can tweak codes in a way so both models (turn-based/parallel) could be used interchangeably - I will definitely add it to the game.
optimother
Posts: 76
Joined: July 12th, 2014, 4:09 am

Re: [DIY] making html5 wesnoth-themed roguelike

Post by optimother »

Shadow_Walker wrote:Okay, this sounds like an off-screen animation issue to me..
Well, it might be, I didn't dig so deep to say for sure, but most possible candidate after my quick investigation is that next_monster_move is not called in some of branches. Because rendering loop worked ok. But mMQ was not empty and not dequeing.
Well, either it is a turn-based strategy, or real-time strategy. ... This is supposed to be a fast game for a lunch time, with no pressing "clock is ticking, your opponent already produced zealots" feeling.
No-no-no, I'm not talking about RTS. The game is absolutely TBS, but rendering is independent.

In your current implementation if I fired fireball I can't do anything until it hits target. The 'clock is ticking', but in opposite direction - you can't do it fast, you have to wait.

In my case you do something and the game state is changed instantly. Your turn is over (in a sense). But effects of your action are still producing some animation. Hope I'll have some time soon to finish it at least a little bit to show without making much insult :)
Also, Javascript is a single-threaded browser-based language, no *real* parallel execution occurs no matter what kind of messaging/queuing is used.
You render dozens of frames per seconds, so in this sense several animation can run in parallel, there's no need in language parallelism. I'm not talking about huge differences, but it feels really different.
I will add a configuration option to allow normal/fast/instant moves.
For me the biggest concern is not the time of move itself, but rather consistency (or lack of) of attack vs move.
Shadow_Walker
Posts: 80
Joined: July 27th, 2014, 4:34 pm

Re: [DIY] making html5 wesnoth-themed roguelike

Post by Shadow_Walker »

optimother wrote:In my case you do something and the game state is changed instantly. Your turn is over (in a sense). But effects of your action are still producing some animation. Hope I'll have some time soon to finish it at least a little bit to show without making much insult :)
Heh, what if that fireball should have killed its target upon impact? In your scenario, I assume that enemy will start its action immediately, without waiting for the impact and associated damage calculation - is it correct? Kaboom, we have enemy mage who managed to send its own fireball in your direction while your fireball is still in flight. If this picture is not correct, than player has to wait anyway. Could you elaborate a little more on the mechanics of the improvement? Example with the exact action ordering and timing is a key here.
Shadow_Walker
Posts: 80
Joined: July 27th, 2014, 4:34 pm

Re: [DIY] making html5 wesnoth-themed roguelike

Post by Shadow_Walker »

There will be no updates for the next couple of weeks as I will be traveling, so here is the 0.84a release:
http://www.wessense.org/

Features:
- added "exp to next level" indicator and text at the bottom
- animation speed control ( extra world parameter, set at the beginning of a game )
- Mirror Image clones now earn exp for player
- day/night now affects Undead and Orc attacks
- click on player triggers "skip turn"
- be careful with Holy Book now, defenders may surprise low-level characters

Fixes:
- a few minor fixes
- off-screen animations are now skipped. It should fix reported game freeze, and will speedup clone army combat.

Since there are ~8000 lines of code, there must be 80 bugs or more. Only one bug is potentially fixed (because it was reported) - be warned..

Linux bundle:
http://www.wessense.org/binaries/wessen ... x64.tar.gz

Mac bundle:
http://www.wessense.org/binaries/wessense-0.84a-mac.zip

Win bundle:
http://www.wessense.org/binaries/wessense-0.84a-win.zip

Image
optimother
Posts: 76
Joined: July 12th, 2014, 4:09 am

Re: [DIY] making html5 wesnoth-themed roguelike

Post by optimother »

Thanks a lot! Fast animation feels much better for me.

Next little thing to fix is to store the map options in localStorage and use them as defaults on restart, what do you think?
Shadow_Walker
Posts: 80
Joined: July 27th, 2014, 4:34 pm

Re: [DIY] making html5 wesnoth-themed roguelike

Post by Shadow_Walker »

optimother wrote:Next little thing to fix is to store the map options in localStorage and use them as defaults on restart, what do you think?
Nope, try again ;)
Next things are:
- to add local bosses (tough versions of monsters), marked with crowns. More hp, more attacks, more damage, more exp.
- to make gold coins useful by introducing weapon and magic shops. No need to run around hacking and slashing If you are rich.. You can just buy that shiny armor and powerful spells (two new types of "house" on map - step on them to see shop dialog).

So.. Here we go, v0.85a
http://www.wessense.org/

- there were quite a few changes in the code, so bugs are highly possible => please let me know if you experience one!
- local boss monsters added => if you see crowned monster, run like hell..
- weapon/magic shops added => use gold coins to buy spells and training sessions
- more changes to speedup animations (including FireFox fix)

Image

Bundles
Linux: http://www.wessense.org/binaries/wessen ... x64.tar.gz
Mac: http://www.wessense.org/binaries/wessense.0.85a-mac.zip
Win: http://www.wessense.org/binaries/wessense.0.85a-win.zip

PS: Yeah.. I promised not to code while on vacation. But I just can't stop doing it :)
optimother
Posts: 76
Joined: July 12th, 2014, 4:09 am

Re: [DIY] making html5 wesnoth-themed roguelike

Post by optimother »

Shadow_Walker wrote:Nope, try again ;)
Next things are:
Those are the Big things :)
- local boss monsters added => if you see crowned monster, run like hell..
Why Ancient Lich doesn't wear are crown? :)
to make gold coins useful by introducing weapon and magic shops. No need to run around hacking and slashing If you are rich.. You can just buy that shiny armor and powerful spells (two new types of "house" on map - step on them to see shop dialog).
If I was rich and weak, I'd buy range first of all, the damage is not so urgent when a lvl2 skeleton kills you (lvl 5-6 human Thief) with a single hit, and you don't even see him in night. Also it would be nice to print ranged attack range and damages with hate bonuses because it's attack is something like 3x12 and I had ~50hp (I saw him in day).
there were quite a few changes in the code, so bugs are highly possible => please let me know if you experience one!
There definitely are :) Just can't reproduce. It was something like this: I started as 1 human thief, respawned near the Fugitive, brought it to the place where forest surrounded me entirely and started clicking on Fugitive. When it died the boar's turn come and when I clicked on boar, the arrows flew to the position of dead fugitive, and messages Fugitive killed were in the log, so I ended up lvl 5 after this :) Then died as described above.
weapon/magic shops added => use gold coins to buy spells and training sessions
I'd like to have the ability to sell some useless spell also, like forest for knight, or entangle - I still haven't figured out what it does, seems like nothing at all?
PS: Yeah.. I promised not to code while on vacation. But I just can't stop doing it :)
Thats the secret recipe of creating something good :)

In the shop +1 ranged costs 12 for everyone, but +1x4 for thief is very much different than +1 for thunderer.

How did Elvish ranger learn so much spells? :) Aside of forest walking ability and occasional instagib, isn't it too much?

By reading some code I suppose you have you have a strong C background :))) While some parts are really clever, the amount of boilerplate is impressive :) In Javascript this

Code: Select all

switch( spell ) {
		case 'sleep':
			GAME.SpellSleep( c, pc );
			break;
       ... 6 more same statements for other spells ...

GAME.SpellSleep = function(c, pc) ...
can be written as

Code: Select all

GAME.spells[spell](c, pc);

GAME.spells = {
  sleep: function(c, pc) { ... }
It would be easier to read, extend and overall code become less prone to errors.
Shadow_Walker
Posts: 80
Joined: July 27th, 2014, 4:34 pm

Re: [DIY] making html5 wesnoth-themed roguelike

Post by Shadow_Walker »

Right, some spell effects were messed up. Proper effects are:
- Entangled = target has reduced damage (1/2), and penalty to armor (subtract 50%)
- Sleep = target armor set to -50%, because unit is helpless
- Shadows = own armor is set to 80%
( help dialog extended with damage and armor modifiers )

Spells were fixed, web version patched in situ, with no version increment. Bundles are still buggy - will update with the next "major" release.
Note that magic shops will now buy back unused scrolls at a slightly reduced price.. see and click that "mode" button to alternate between buying and selling.

Lvl2 skeleton archer is really deadly at night, allright. With up to x2 night damage modifier (Undead night bonus), Armor Piercing trait (halves opponent's armor, unit bonus) and regeneration (Undead night bonus) it becomes really deadly for low level adventurers. Isn't it fun? :)
I'd recommend to plan your nights carefully.. Use Shadows spell to increase your armor to 80% (terrain independent), don't get caught in open - use terrain obstackles to hide from archers.

For now, I do not worry much about balance. Game is still in alpha stage: new features being added. As soon as major features are in and obvious nuts and bolts are tightened up, we will revisit game balance.

DISCLAIMER extention: Warning! Reading game code at this stage may have a devastating affect on your ability to program things, or even perform simple logical actions in real world. Printed excerpts from this code were 100% successful in scaring away erratic crows, hungry mosquitoes, reckless chipmunks and other dangerous species - proven by repetitive backyard tests.
goblinThing
Posts: 32
Joined: May 5th, 2013, 6:26 pm

Re: [DIY] making html5 wesnoth-themed roguelike

Post by goblinThing »

Just thought i'd pop by to tell you that I'm enjoying your game. I have not encountered any bugs with this version, (I check to see how it's coming along every now and again) which is much more polished. The one biggest thing I'd like to see added is descriptive tooltips for the spells.

I also think the game would be more fun if the player could save up to buy truly epic shop items instead of stocking up on stuff he already has.

This is coming along nicely. I hope you're having fun building it, cuz I'm having fun playing it!
Post Reply