[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 »

optimother wrote:If sprite is currently animating something, then callback is just discarded. And it could happen if attack is longer than defend, because only defend is queued.
That sounds about right.. I did not check it yet, but it is matching my gut feelings pretty well. Will incorporate your fix in the next release.

As a tiny script at the bottom of splash screen says, everybody is welcome to do whatever they want with W.Essense code. You are officially allowed to create repositories, make your own changes, maintain forked versions, sell it for millions of dollars/euros etc. If you manage to sell it for more than $10k, please let me know how you did that trick, okay? :)

LINK: http://www.wessense.org/
Last edited by Shadow_Walker on September 14th, 2014, 1:18 pm, edited 1 time in total.
optimother
Posts: 76
Joined: July 12th, 2014, 4:09 am

Re: [DIY] making html5 wesnoth-themed roguelike

Post by optimother »

Shadow_Walker wrote:That sounds about right.. I did not check it yet, but it is matching my gut feelings pretty well. Will incorporate your fix in the next release.
The particular fix I pointed at seems wrong too, I commited an improved one, but still not sure if it helps.
As a tiny script at the bottom of splash screen says, everybody is welcome to do whatever they want with W.Essense code. You are officially allowed to create repositories, make your own changes, maintain forked versions
It'd be easier to maintain forks if you'd use something like git too ;)
, sell it for millions of dollars/euros etc. If you manage to sell it for more than $10k, please let me know how you did that trick, okay? :)
Of course. But I'm not sure if I'm capable of decyphering such a strong code encryption, every single my commit is turned out wrong and required couple more to fix it :)

I implemented auto-attack with 'a' key, and shift+'a' to attack neutrals too. Feels very good to me.

Also I noticed that 'q' quits the game without any notice, tried to add confirm('sure?') but after 10 minutes of figuring out how still failed :)

Btw, since you've grabbed top post on this page you can add link to play game again, that was handy.
User avatar
ChaosRider
Posts: 846
Joined: April 15th, 2012, 1:15 pm

Re: [DIY] making html5 wesnoth-themed roguelike

Post by ChaosRider »

I found a bug, quite frustrating atleast for me, its quite simple to do it again.
Let say you start a game with thief, and you find wood golem or that bigger ogre (with 3), so to kill him you run to forest where he cant reach you (you must be on one of positions ne,nw,se,sw from his place). Ofcourse as a 1 lvl (low lvl) thief you deal small dmgs in each strike so you start to spam with left click in mouse, and whats going on after killing that enemy?
Game is getting more crazy:
- you may have situation when you while attacking next enemy see how your dagger flew by whole screen and you get 180 xp as when you killed that ogre/wood golem and even that you click on enemy he dont get dmg
- you may have situation when you get dmg from enemy which is not near your unit (atleast you cant see him, cause its not on screen), so you can also die by dmgs from noone who could reach you.
Last edited by ChaosRider on September 14th, 2014, 1:41 pm, edited 1 time in total.
Creator of WOTG (+2880 units), MWC (+615 units), SurvivorsArea, RandomColosseum, RC WOTG, RC MWC, ColosseumRandomClonesBattle, BetweenDarknessAndLight, StealingWeapons, MoreUnitsForms, MoreDamageTypes, CanBeOnlyOne, ColosseumOneWinner, BonusSpam, CriticalStrike - available at 1.12 Wesnoth server.
Shadow_Walker
Posts: 80
Joined: July 27th, 2014, 4:34 pm

Re: [DIY] making html5 wesnoth-themed roguelike

Post by Shadow_Walker »

Rapid attacks cause issues? Need to check if disableControls flag is used properly till the very end of attack sequence.

2optimother:
git is not my thing.. I am used to CVS and SVN, but git just escapes me for some reason. I tried it for a couple projects with 100k+ lines (many submodules inside) and it failed miserably, probably that's why. It should work for any tiny project, though. But if one knows how to use SVN, and internet connectivity is always there, why bother with git?

Also, current code requires a lot of reshape (members -> structs) to allow easy extention and save game serialization. This requires time which I don't have right now. Which code encryption we are talking about? I believe there could be some comments in transliterated Russian, but otherwise it is not encrypted. Just a plain ol' js code without any apriori knowledge on how js is actually supposed to work :)
optimother
Posts: 76
Joined: July 12th, 2014, 4:09 am

Re: [DIY] making html5 wesnoth-themed roguelike

Post by optimother »

ChaosRider wrote:I found a bug, quite frustrating atleast for me, its quite simple to do it again.
I reported it above, and thought that would fix it really quick, but it seems to be quite tricky, so for now just slow down clicking when enemy has low hp :)
Shadow_Walker wrote:git is not my thing.. I am used to CVS and SVN, but git just escapes me for some reason. I tried it for a couple projects with 100k+ lines (many submodules inside) and it failed miserably, probably that's why. It should work for any tiny project, though. But if one knows how to use SVN, and internet connectivity is always there, why bother with git?
Because there is github (git makes it's existence possible). I'm not into the tools holywars, I find creating something using whatever suits your taste more interesting.
Also, current code requires a lot of reshape (members -> structs) to allow easy extention and save game serialization.
It's normal way to do it: implement quick-and-dirty, then clean up and make it possible to grow.
User avatar
ChaosRider
Posts: 846
Joined: April 15th, 2012, 1:15 pm

Re: [DIY] making html5 wesnoth-themed roguelike

Post by ChaosRider »

Next bug found, i pick allways the biggest map size, but when im at it highest and lowest for x,y places then screen stuck, to see whats happened i have to move out a bit of map edge. Its a problem because some monsters are near map edge, also as now its stuck me a game in my own turn (save & reload is really need here :P), not enemies.
Creator of WOTG (+2880 units), MWC (+615 units), SurvivorsArea, RandomColosseum, RC WOTG, RC MWC, ColosseumRandomClonesBattle, BetweenDarknessAndLight, StealingWeapons, MoreUnitsForms, MoreDamageTypes, CanBeOnlyOne, ColosseumOneWinner, BonusSpam, CriticalStrike - available at 1.12 Wesnoth server.
optimother
Posts: 76
Joined: July 12th, 2014, 4:09 am

Re: [DIY] making html5 wesnoth-themed roguelike

Post by optimother »

Seems like I've fixed the race conditions, and added 'Feeling lucky' button to start with random hero.

ChaosRider, it'd be nice if you could check my implementation. To do it just download archive https://github.com/optimouser/wessense/ ... master.zip and open index.html
User avatar
Crow_T
Posts: 851
Joined: February 24th, 2011, 4:20 am

Re: [DIY] making html5 wesnoth-themed roguelike

Post by Crow_T »

It looks like the "do I feel lucky" button randomizes everything but the hero, it'd be nice to keep the other settings adjustable.

Just got a freeze on the optimother standalone- is it possible to use something like firebug to report decent bug info?
optimother
Posts: 76
Joined: July 12th, 2014, 4:09 am

Re: [DIY] making html5 wesnoth-themed roguelike

Post by optimother »

Crow_T wrote:It looks like the "do I feel lucky" button randomizes everything but the hero, it'd be nice to keep the other settings adjustable.
Hmm, actually it randomizes only the hero and random seed :) all other settings are same as you selected previous time.
Just got a freeze on the optimother standalone- is it possible to use something like firebug to report decent bug info?
Thanks for testing! That's really bad :)

In console you surely can find the info, but it's really hard to tell what to look for. You can execute GAME.mMQ.dequeue('monster_move_queue') after several times your move will start. Then kill images first, and then them who they were fighting with
Shadow_Walker
Posts: 80
Joined: July 27th, 2014, 4:34 pm

Re: [DIY] making html5 wesnoth-themed roguelike

Post by Shadow_Walker »

( optimother declined an offer to maintain centralized updates for a few weeks, so I am forced to do it myself )

Mixed bugfix update: W.Essense 0.87a
http://wessense.org/

Changelog:
[x] Visual effects added for Meteor, Tornado, Rain spells. Rain now causes damage too. Pretty graphics was "borrowed" from Wesnoth Mod recommended somewhere in this thread.
[x] Bleeding has 50% chance, Poison / Entangle = 20%. Enemies now suffer from poison and bleeding too. Bleeding is inflicted in hand-to-hand attacks only.
[x] Random hero selection button added. It's not a "feeling lucky" button, though.
[x] Game now remembers land selection choices. Just to stop people from telling me how easy is localStorage to work with, okay? :)
[x] Night time reduced, now durations are 60% day, 20% night, 10% morning/evening. Long nights turned out to be too scary, right.

[x] Buggy regeneration fixed..
[x] Dwarven quest is now for dwarves only, even with Fly spell.
[x] Player controls now disabled during attack sequences. Weird arrow/magic shots should be gone.
[?] Potential fix for "game is stuck in the 'enemy move' loop".
[?] Partial protection against moving out of game area boundaries. Not sure how it will look like near those boundaries, though. Did't go there yet.

As usual, almost nothing was tested before upload, so if you encounter bugs - spell them out loud, preferably with screenshots and brief description of how to get into such trouble.

Bundles
Linux64: http://wessense.org/binaries/wessense-0 ... x64.tar.gz
Win: http://wessense.org/binaries/wessense-0.87a-win.zip
Mac: http://wessense.org/binaries/wessense-0.87a-mac.zip

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

Re: [DIY] making html5 wesnoth-themed roguelike

Post by optimother »

Shadow_Walker wrote:( optimother declined an offer to maintain centralized updates for a few weeks, so I am forced to do it myself )
Yep, because your changes are in quite opposite direction of what I've done, so I don't want to do my game out of yours.
[x] Visual effects added for Meteor, Tornado, Rain spells. Rain now causes damage too. Pretty graphics was "borrowed" from Wesnoth Mod recommended somewhere in this thread.
Looks great, especially rain.
[x] Random hero selection button added. It's not a "feeling lucky" button, though.
What's the point of it? Feeling lucky is to start game immediately (saving you 5-10 clicks), but random hero selection just same as clicking a hero. What's the point of disabling hero reselction: why if you clicked on a hero you can't select another, but if you click next and then prev - you can?
[x] Game now remembers land selection choices. Just to stop people from telling me how easy is localStorage to work with, okay? :)
Okay, but I find my implementation of the dialog itself much cleaner. ;)
[x] Night time reduced, now durations are 60% day, 20% night, 10% morning/evening. Long nights turned out to be too scary, right.
Now probably it's even too short.
[?] Potential fix for "game is stuck in the 'enemy move' loop".
Now rendering with horde of mirrors is jerky. I think the proper way is to do one monster action at render frame (if it does something, no need to wait for all 2115 standing still). Because when you have 20 mirrors you make a step, then static image is displayed for a second, and then the new image appears with lots of changes.

I don't know how about you but after playing with auto-attack it just feels broken without it :) I'll try to merge some changes from 0.87 with my, but it's a pain to do.
User avatar
ChaosRider
Posts: 846
Joined: April 15th, 2012, 1:15 pm

Re: [DIY] making html5 wesnoth-themed roguelike

Post by ChaosRider »

Tested newest and still i got errors when i move near map area end, my game first stuck i had duplicated some images like these water villages (atleast these images are villages in battle for wesnoth), when i clicked that hourglass to stop time all duplicated images dissapeared but still my game was stuck.
Creator of WOTG (+2880 units), MWC (+615 units), SurvivorsArea, RandomColosseum, RC WOTG, RC MWC, ColosseumRandomClonesBattle, BetweenDarknessAndLight, StealingWeapons, MoreUnitsForms, MoreDamageTypes, CanBeOnlyOne, ColosseumOneWinner, BonusSpam, CriticalStrike - available at 1.12 Wesnoth server.
Shadow_Walker
Posts: 80
Joined: July 27th, 2014, 4:34 pm

Re: [DIY] making html5 wesnoth-themed roguelike

Post by Shadow_Walker »

optimother wrote:
[x] Random hero selection button added. It's not a "feeling lucky" button, though.
What's the point of it? Feeling lucky is to start game immediately (saving you 5-10 clicks), but random hero selection just same as clicking a hero.
Same, but random. It is not "5 clicks" that causes issues, but a need to make tough choices every day. One day you realize it, young padavan ;)
optimother wrote:
[x] Game now remembers land selection choices. Just to stop people from telling me how easy is localStorage to work with, okay? :)
Okay, but I find my implementation of the dialog itself much cleaner. ;)
Haven't seen yours yet. I just tried "lucky" button, which did a weirdo jump over all settings right into the game.. Will check code changes later on.

2ChaosRider
Yep, I just added proper checks so units will never move out of those boundaries. But rendering and game behavior at edges was not checked at all. Initially, there was no way to travel to those edges. Will implement Wayward's approach - if you go to the very edge, you may end up arriving to the next island in a chain :)
optimother
Posts: 76
Joined: July 12th, 2014, 4:09 am

Re: [DIY] making html5 wesnoth-themed roguelike

Post by optimother »

Shadow_Walker wrote:Same, but random. It is not "5 clicks" that causes issues, but a need to make tough choices every day. One day you realize it, young padavan ;)
.. And once you've realized that, you name the button feeling lucky that goes straight into the game, because deciding between normal or hard difficulty, map size and amount of resources are way more tough choices than picking a hero. :)
Haven't seen yours yet. I just tried "lucky" button, which did a weirdo jump over all settings right into the game.. Will check code changes later on.
I've merged gameplay-related changes from 0.87. And added a delay between mirrors moves, now their move is longer time (50ms x mirror steps) but you see it and it's clear what's happening. The movement is far from smooth yet.

The lockup is still possible :) I haven't tried in wessense.org version but seems to be the same.

Btw, in the EntityAttacksEntity the GAME.mDisableControls = false; is wrong because it should set it to previous value, not false (imagine a monster attacking another monster, and this enables controls). This is not a big issue now, but some day it will show itself.
User avatar
ChaosRider
Posts: 846
Joined: April 15th, 2012, 1:15 pm

Re: [DIY] making html5 wesnoth-themed roguelike

Post by ChaosRider »

Next bug found in shop, you can spend money for increasing unit armour but it cant be higher than 65% (atleast for elv archer).
Creator of WOTG (+2880 units), MWC (+615 units), SurvivorsArea, RandomColosseum, RC WOTG, RC MWC, ColosseumRandomClonesBattle, BetweenDarknessAndLight, StealingWeapons, MoreUnitsForms, MoreDamageTypes, CanBeOnlyOne, ColosseumOneWinner, BonusSpam, CriticalStrike - available at 1.12 Wesnoth server.
Post Reply