Modify combat for gamified learning?

6 replies [Last post]
MarkU
User offline. Last seen 17 weeks 19 hours ago. Offline
Joined: 2019-01-20
Posts: 2

Hi - new here, sorry if this is a dumb question.

I am looking for a turn-based game where I can customize the combat system in some way to reflect success / failure in an external task (e.g. it would call my external code, which would require the player to solve a math problem, or spell a word correctly, etc, which would then return the results back into the regular flow of the game). For example, maybe a shot misfires if you are wrong, or doesn't make as big an explosion, or whatever.

The motivation is gamification of learning - my kids (8 & 11) respond really well to for example the Prodigy game, but I'd like to explore a more personalized range of material.

Is this practical within Hedgewars? If not, does anyone have any alternative suggestions?

thanks

Mark

Wuzzy
Wuzzy's picture
User offline. Last seen 16 hours 27 min ago. Offline
Joined: 2012-06-20
Posts: 1054

First of all, Hedgewars is definitely NOT an educational game. Big Grin

Modifications that you have requested would require quite deep changes in the source code, I think, since you want to call external code. If that's your goal, you almost certainly have to fork our code. Sad Smiley

However, we do have a scripting API using the Lua programming language. This allows us to introduce new game modes ([hwkb]styles[/hwkb]) and missions. Just try out the official styles in the game to see what is possible.

Maybe if you would describe more specifically what you want to achieve. A concrete use case would be nice.

Hi, I am a Hedgewars developer. Smile I accept personal donations in bitcoin. Heart 17fsUywHxeMHKG41UFfu34F1rAxZcrVoqH

nemo
nemo's picture
User offline. Last seen 1 hour 30 min ago. Offline
Joined: 2009-01-28
Posts: 1697

I agree the lua API seems a sensible place to do this.
That said, for security we've tried to make it tricky to call external stuff from the lua. It isn't entirely sandboxed though, and you could always disable the existing restrictions to make it even easier. It might be possible to do the entire extra stuff entirely in lua, although it'd be rather convoluted. Another option possibly is to interact w/ external code through the log file..

--
Oh, what the heck. 1PLXzL1CBUD1kdEWqMrwNUfGrGiirV1WpH <= tip a hedgewars dev

MarkU
User offline. Last seen 17 weeks 19 hours ago. Offline
Joined: 2019-01-20
Posts: 2

Ok, that might be a bit more complex than I was hoping for.

In terms of use-cases, my immediate objective is to tie in music practice. I am writing some code in python that can capture note and duration (no chords, just basic melody from e.g. a mandolin or violin). It will import in abc format, render it and say "play this" and then score you based on how well you do.

In-game it could be tied to really anything that would make a kid pleased with themselves - explosion size is the sort of thing I can see being popular (saying "poop" probably would be too but for various reasons I would prefer not). So e.g. you go to fire a weapon, game pauses, my code is called, kid plays something on their instrument, my code listens, assesses, and then returns a value that the game then uses to determine how big a hole is made etc.

In the longer term, it'd be cool to have an API standard for task insertion into games, so that the game doesn't care about the details of the task, it just ties some game-relevant effect to the returned success score. Then today I write one for music, tomorrow someone else does one for translating Sanskrit or whatever they want their kids to learn, etc. It's amazing how motivating gaming has been for my kids for math, and I think the focus on winning the game just makes the practice/effort component invisible for them.

The main issue is, making time to write the audio code is challenging enough, so I'd really like to be able to focus on that part, and then slap it onto a game component that others have already put the effort into. Realistically I'd not have time to maintain a fork. I'm not wedded to any one game, so if you have alternative suggestions that might be a better fit, that'd be great.

nemo
nemo's picture
User offline. Last seen 1 hour 30 min ago. Offline
Joined: 2009-01-28
Posts: 1697

Have you looked over the Lua API yet? It's fairly extensive, and some modes do fairly complex things using it. Construction Mode for example.

BTW, on music front, try pressing F1-F12 when using the Piano weapon in Hedgewars ☺

Anyway, while there's a lot of events, the main thing missing is external hooks. That'd be the thing we'd have to look into 'cause obv that's usually a non-desirable thing in a game script ☺

Anyway come by chat to discuss.

--
Oh, what the heck. 1PLXzL1CBUD1kdEWqMrwNUfGrGiirV1WpH <= tip a hedgewars dev

nemo
nemo's picture
User offline. Last seen 1 hour 30 min ago. Offline
Joined: 2009-01-28
Posts: 1697

BTW, unc0rr also votes for making a patched version w/o lua protections. Smile

--
Oh, what the heck. 1PLXzL1CBUD1kdEWqMrwNUfGrGiirV1WpH <= tip a hedgewars dev

Wuzzy
Wuzzy's picture
User offline. Last seen 16 hours 27 min ago. Offline
Joined: 2012-06-20
Posts: 1054

Yeah, as said, this would require major changes to the engine and also definitely is not what the game is about. So you will be (mostly) on your own, sorry.

Quote:
The main issue is, making time to write the audio code is challenging enough, so I'd really like to be able to focus on that part, and then slap it onto a game component that others have already put the effort into. Realistically I'd not have time to maintain a fork. I'm not wedded to any one game, so if you have alternative suggestions that might be a better fit, that'd be great.

Maybe take a look at Minetest, this is a game engine that is built to support mods, has a very extensive Lua API (far more extensive than Hedgewars'), and there is a very active modding community. Just talk to the forums, read the wikis or talk in the IRC to get started.

Hedgewars is just not built for major changes like that. It's still a game, after all.

Hi, I am a Hedgewars developer. Smile I accept personal donations in bitcoin. Heart 17fsUywHxeMHKG41UFfu34F1rAxZcrVoqH

Copyright © 2004-2017 Hedgewars Project. All rights reserved. [ contact ]