The Child of the Hill House (advjam2018)

Hello, I’m here again just to show something new I’ve done with you great engine - an adventure game (with a supernatural theme) done in only 14 days for AdvJam2018 (http://jams.gamejolt.io/advjam2018)

I was quite curious to see how I could work with your tool in a relatively strict time frame and so this year I’ve decided to try it for this jam (it was my third time, and I’ve never been able to submit a fully playable game in that range - till now)

I’ve just taken a couple of days to study my needs and to bootstrap an adventure point’n’click engine before the jam and after a quick test (and after seeing that Tiled could export data in a json format that was perfect for Defold) I started this project

I’m not a Lua expert (I’m a C/C++ coder) but using Defold as the base for the game engine was surely a good idea. I’ve changed a lot of things while I was proceeding with the game (I mean, I started with game script inside Tiled object properties, then I decided to have game scripts in a separate json file, then I saw I needed a more complex script engine for the game and I did it, then I rewrote it again to make it quicker to edit - and I’ve done all these things in 14 days, while I was also writing the story and creating the images and animation - this, and living, and working and so on, I mean, not exactly 14 full days of game programming)
I’ve also continued to change the engine adding features till the last day - and the reason I was able to do so is that your engine / lua script / gui system was solid and easy enough to limit the mess while I was writing and changing and writing again. With the fact that (for the first time for me) I wasn’t worried about the release of the game (because this was Defold task - I just needed to make everything right on PC, and then build for HTML5 - and Mac, as bonus)

Only two complaints:

  • at least on Windows syntax errors in Lua are not reported with line numbers (at least lately, building for test - they’re visible only if I do a bundle build)
  • search and replace work in a way I like less than the ones in VS (or even in Notepad++ - my companion for this jam, because I could edit json resource in Defold)

But everything else was really great - and let me do things fast and have the results I wanted (I mean - what is not perfect in my game is due to the short time I had and my relative skills - not surely to problems I had with Defold.

These are some screenshots of the game - if you are curious about it

And if you want to give it a look you can find it here: https://gamejolt.com/games/thechildofthehillhouse/337760

14 Likes

Nice report Marco.

I’m curious to see for what you used tiled more in depth. Is it to define doors, objects, walk paths?
What about the puzzles themselves?

My initial idea was to use JUST tiled. And to use properties values for objects elements as repository for puzzle related elements

But when I tried to implement things I’ve decided for the game I choosed a mixed path: in Tiled map I have just walking area - active elements (with their shape, basic description for look at, and few more things) and I’ve decided to use a parallel json to keep “action”, entering behaviour and so on. I mean, I needed a script language, and so I implemented a key,value basic-like way to handle things.
That’s for instance the first part of the handling of the first forest scene

"f_a":[{
	"_":[{
		"onfirst":[
			{"setpos":"48,185"},
			{"moveto":"120,185"},
			{"say":"With this light the car should be invisible here"},
			{"say":"Now I just have to find my way to the house"},
			{"moveto":"180,185"}
		]
	}],
	"_from":[{
		"f_b":[
			{"setpos":"328,185"}
		]
	}],
	"car":[{
		"lookat":[
			{"say":"It's a beautiful Ford Mustang someone parked in the wrong place"},
			{"say":"It's almost a sin that I have to burn it when I've completed this mission"}
		],
		"use":[
			{"say":"I'll use it when I'll be back, once completed this mission"}
		]
	}],
	"path":[{
		"lookat":[
			{"say":"It's a path getting into the woods. The house seems to be in this direction"}
		]
	}],

really easy to parse in LUA - and perfect as mix with Tiled (where I set the name for the elements, with their position)

THEN I decided to use a YAML like syntax - and I created a small C tool to compile it in json
So I actually write things this way

f_a:
	_:
		onfirst:
			setpos: 48,185
			moveto: 120,185
			say: With this light the car should be invisible here
			say: Now I just have to find my way to the house
			moveto: 180,185
	_from:
		f_b:
			setpos: 328,185
	car:
		lookat:
			say: It's a beautiful Ford Mustang someone parked in the wrong place
			say: It's almost a sin that I have to burn it when I've completed this mission
		use:
			say: I'll use it when I'll be back, once completed this mission
	path:
		lookat:
			say: It's a path getting into the woods. The house seems to be in this direction
	route 18:
		lookat:
			say: This way I can get to the main road
		moveto:
			say: Don't think going back to main road makes sense
			say: Better find a way through the woods

and of course they will be mixed up with similar script for each object and each actor in the game

At the end I still put some game code in the Defold program (because it was quicker - I mean for the gun, that has limited bullets) but most of it is in the main json file

If I had the all the code that I’ve got now I’d be able to do more in this game - but most of this system has been written DURING the jam.

1 Like

ah - sorry I forgot to tell you that (of course) I can use two kinds of thing as variables in the script system: set (memory) and inventory - the following are two separated piece of scripts
This way I can make action set variables that then I can use to modify the game

narrow path:
	lookat:
		say: it's a narrow path in the woods
	moveto:
		ifnotset:$templeseen
			say: Waste of time. House is just over there
		else:
			loadroom:f_e
		endif:

	lookat:
		say: A dead body, with clothes similar to mines
		say: Nothing in his pockets or in the jacket
		ifdonthave:golkenkey
			say: But he has something in his hand
			say: A golden key! What else should I find on a dead body in a temple in the woods?
			take: goldenkey
			say: Taken
		endif:
1 Like

Yeah, I’ve noticed the line number issue as well. Remember to add the bugs to the editor issues!
I’ve added this one here: https://github.com/defold/editor2-issues/issues/1902

2 Likes

sorry you’re right. I should have done so (the fact is that I’m used to your magic :slight_smile: - I usually see fixes “on-the-run” so I got lazy)

1 Like

How are you parsing your pseudo yaml script?

I wrote a C program to do it (for me it was faster/easier than write a LUA parser - but that would be wiser I get).
Now I write/modify the (yaml like) game script then I run it to generate the json (that’s included as resource in Defold project)
Seems tricky (I mean, I write a script, then I convert it, the I run a program that parse it back in order to run it for the game) - but it’s anyway faster to write game script this way - and the process is simple (run the tool, run the game)

Really interesting.

Any other particular thing you did on the game that you want to share?

thanks for sharing your experience. It is of enormous value to us and our users. Also the game is nice!

also I agree with @gianmichele - perhaps what you did, Marco, can be isolated into a kind of Adventure Games Building kit based on Tiled and the pipeline you invented?

1 Like

yes - I was thinking about that.

I’ve played a lot of other games in this jam (quality is astonishing - probably is the reason for fewer participants compared to the previous years) and I’ve seen that most of those games have been made with Unity (even the smaller 2D ones I mean)
No real reason for that (and the result was smooth, but huge) apart for the fact that this system (and some other ones) offers some an adventure package sdk “ready” to start an adventure game (and well that probably authors know this engine and they already use it for other reasons)

Don’t think my engine could change this predominance but maybe releasing something that can make an adventure simpler to compose (even if there will be the need to use several separated tools - but well they’re all free) could offer a plausible alternative in some cases. I mean I’ve seen also some games made with Godot that I guess were based on an adventure free released SDK - so it should fit

I’m finishing to polish the code (and move to the script some game logic that I’ve put in the engine to work faster) and I guess I can think about how to release that to be usable by others

1 Like

Loved the result! Impressive.
Big fan of these type of games and as I have more time I will find out the mysteries inside that door full of symbols…

1 Like

Thanks :slight_smile:

You’re right…

So we’re in a process of setting up a developer fund to inspire Defold users share their engine extensions with the community. Hope to share more soon.

2 Likes

You that seems a great news :slight_smile:

Anyway I think I’ll be able to release a first version during this weekend. I’m talking more time because I’m trying to make everything more usable (and so to separate more adv game user “code” and Defold) and so I’m preparing a tool to “compile” everything in order to generate Defold elements from tmx/yamlike-script (at the moment I’m generating atlas, go elements and scene collection - but I need also to generate sound info)

The idea is to download the game template from asset library and then work on a “advsrc” folder lfrom which you’ll be able to generate the file for the game scene in another specific project folder. So you’ll just need to work there, and then run the tool, and the run the game from Defold to play
First version will be probably limited but my idea is to make changeable some other aspect of the game that from start will be fixed (you could change them by your own in Defold project of course)
And of course you won’t need the tool - you’ll have to game engine code in lua in the game project so you could technically do everything by your own using Defold (but it will be easier(faster working in the other way)
I’ll release this template with a two rooms sample game - so it will be visible what you can achieve (and how)

2 Likes

Ok - I released now a preliminary version of this adventure SDK for Defold - with MIT Licence. It come with a short demo with its sources (graphic is mine, and it’s CC BY 3.0)

I’m aware that a full documentation should be included (together with more examples and the compiler tool built at least also for Mac) but maybe this can be a good start to see if anyone could be interested in a thing like this.

8 Likes

cool cool! I’ll try to play with it this week.

2 Likes

so I tried to play with your DefAdvSDK @marco.giorgini and it looks good!
Now I am trying to figure out the pipeline/process that worked for you. Do you use Tiled as a level editor, then just export those to .tmx and generate .jsons/gos?

Also what’s the process that worked for you to set up quests?

Thanks!

1 Like

Thanks for taking time to check it :slight_smile:
With the latest version of the acompiler I read directly tmx files (Tiled files) so there’s no need anymore to export them in json (I changed things in that direction - so in Defold project the only external files need are main.json - the “script” json - and loc.json - the rooms json)

The pipeline is this one:

  • with Tiled you can add/modify rooms (adding/changing hot spot and attributes)
  • with a text editor you add/modify the main.txt script file (that contains game configuration AND all the action/quest handling - with session for actors, objects and rooms)
  • after a change you run acompiler and then you can run the project in Defold to play it (acompiler will add graphic elements, and add/modify atlas and sound and go objects, based on main.txt - so you don’t have to do anything in the Defold project - if you don’t want/need to override some sdk behaviour not (already) handled in configurations)

Basic game structure consists in

  • defold project
  • advsrc folder with script, tmx, gfx and sounds

Basic adventure structure consists in

  • main.txt with basic configuration
  • at least ONE tmx file (one room)

Sample adventure has splash + home + three rooms and if you check main.txt you’ll see how actions are handled (I also wrote a partial commands list in wiki part of the git repository)

I’ve already added the ability to have a differend hud (one like classic point’n’click games - with verbs and inventory on the bottom part of the screen) but I still have to finish some handling (and then I’ll provide a sample project even with that configuration)

Some notes:

  • at the moment acompiler is (only) a win console binary. I’ll add a similar tool even for mac
  • you can work even without it - because you can write json files manually (i did it for the jam - I wrote the compiler program just before jam deadline - but it changes a lot the speed of the work - of course
  • the animations are handled with a .txt file that replicate the atlas attribures (but the compiler with merge them in a single atlas for actors - while it’s possible to define an atlas attribute in tmx files - so that rooms elements can be in different atlas - I used this choice in my game - not in the demo)
  • sounds are supposed to be ogg (it’s a thing I’ll surely change)
  • main.txt uses tab for roles of the lines - so one must keep that in mind while working

Final notes:

  • it works but (using notepad++ and tiled - and with only the wiki) there’s a not impossible but not supereasy learning curve to start to use it for a game
  • it still lacks some elements (I plan to add) to be able to do “everything” I checked in other engines - I for instance have to put back the code for polygonal movement area (it had some issues and I removed it completely before the submit) and there’s not (at the moment) support for 1) localization (I plan to do it - at least up to a point) and 2) voice for characters (I don’t know if I’ll do that)

I surely want to use it for other projects - and I’ll keep the open source version updated with any improvement (and with at least another sample).
I’ll be happy if anyone else will use it to create some cool adventure for Defold :slight_smile: - but I think that it will be a lot more usable if it would have a more integrated system to create/edit rooms - and to edit script related to game objects/game logic (at the moment even the main.txt or the json files must be edited outside the Defold editor)

If you have questions (and/or suggestions) I’ll be glad to hear them

3 Likes