2020-08-13 23:56:44 (edited by chrisnorman7 2020-10-05 17:37:05)

Hi all,
I've been working on a game library for my own use for a bit now, and thought it was maybe time to let the rest of the community loose with it.

It's the library I used to make my Lucky Thirteen game, and I'm kind of expanding it as I need new features.

Sound is using Synthizer behind the scenes, and I have made some utility functions for loading and playing sounds. More will come as I realise what I need.

Everything Is documented, although the read the docs page is outdated, because I can't get it to automatically build yet. That is something I will fix eventually.

Current features include (but aren't limited to): the ability to create actions which can perform anything from quitting the game to moving around levels. These actions can be bound to various triggers, like keys on the keyboard, mouse button presses, and game controller buttons and hats.

You can bind events to levels using standard Pyglet events, and hopefully there's enough there to prevent people from needing to subclass.

There's no networking yet, although that's something I'd like to implement if and when I figure out the least horrifying way of doing it.

Anyways, the code can be found here, and of course you can

pip install earwax

.

There's an example in the repo, or you can check out the Lucky Thirteen source if you want something bigger.

I'll keep this thread for questions, suggestions or whatever else.

If you've found a problem (I'm sure there's many), or you've got a well thought out issue, feel free to submit an issue.

-----
I have code on GitHub

2020-08-14 00:05:53

The name isn't terrible.  Would be cool to see a brief feature list somewhere.

I'm glad to see more people working on foundational ecosystem pieces.  We need a *lot* more of that.

My Blog
Twitter: @ajhicks1992

2020-08-22 14:39:25

@2
Sorry, only just noticed this. You're absolutely right. I'll work on that now.

I'd really like suggestions for new features, as well has how people would like to see them implemented (menus that make sounds is something I'm wondering how to best implement right now).

-----
I have code on GitHub

2020-08-24 11:00:34

Synthizer is broken in the latest version I believe.

Ivan M. Soto.
Feel free to check out my work and services.
http://ims-productions.com

2020-08-24 15:14:22

@4
If this is the case, please open an issue and I'll be happy to fix it.  The only ones I haven't responded to in a timely manner are feature requests.  I've usually gotten bugs fixed within a week of knowing about them.

if it's the flac decoding issues, that was solved a while ago.

My Blog
Twitter: @ajhicks1992

2020-08-25 00:34:56

OK, for anyone who's interested, earwax now has a configuration module, so you can write your game settings in a class and have earwax generate a settings page for you.

It's all there in the documentation page.

-----
I have code on GitHub

2020-08-26 15:59:03

I can not install earwax. When i try, it sais it can't find synthizer in pip.

Lamas with hats, but with sponge bob as carl Stay tuned.

https://www.youtube.com/channel/UCvAUQt … subscriber

2020-08-26 18:05:00

Ah. That.  You need to be on Python 3.6 or later, and 64 bit.  If either of those isn't true you'll probably get that error.  Also note that if you're on Python 2, Python 2 isn't ever going to be supported by me, and probably isn't supported by Earwax either.

if that's the brokenness @4 is also referring to, sorry, it's known, it's going to take me at least a day to fix, I have bigger fish to fry first.

My Blog
Twitter: @ajhicks1992

2020-08-26 18:16:39

@8 i am on 32 bit, the wierd thing is how ever that the python.org website only shows me the 32 bit version even if i know for a fact i am on 64 bit, also it makes compilation for 32 bit machines much harder to perform if not completely impossible. Thanks for the info though.

Lamas with hats, but with sponge bob as carl Stay tuned.

https://www.youtube.com/channel/UCvAUQt … subscriber

2020-08-26 18:27:41

@9
I know it's an issue, and if you're volunteering to fight the horrifying intersection of CMake and Appveyor which is currently going wrong even though it shouldn't, please feel free to do so.  Otherwise it's 10 minutes or so per attempt at a fix and there's no way to do it on my machine unless I get very lucky.  Given that 32-bit people are rare and that reverb is super super useful it's not priority at this time.

My Blog
Twitter: @ajhicks1992

2020-08-26 18:35:24

@10 Yeah i know, my main prob is right now just that it is only giving me 32 bit for download.

Lamas with hats, but with sponge bob as carl Stay tuned.

https://www.youtube.com/channel/UCvAUQt … subscriber

2020-08-26 18:38:33

@11
You can almost certainly click some sort of show other options link or something, but are you sure you're not on a 32-bit install of Windows?

My Blog
Twitter: @ajhicks1992

2020-08-26 18:56:17

@12 i will try again later today. And yeah, i am definitely running on 64 bit. It's Windows 10 1909 (64-Bit) build 18363.1016.

Lamas with hats, but with sponge bob as carl Stay tuned.

https://www.youtube.com/channel/UCvAUQt … subscriber

2020-08-27 23:41:58

Nah, Earwax probably doesn't support Python2 either, and as I'm relying heavily on type hints, it's not going to either.

Here's a direct link to download Python 3.8.5, 64 BIT.

HTH.

-----
I have code on GitHub

2020-08-29 20:40:10 (edited by chrisnorman7 2020-08-29 20:41:14)

Hey all,
I'm starting on the game maker part of Earwax, and I'm hoping to get some input on what sort of interface people would like to see?

I'm working on a command line interface currently, so the work flow would be something like:

mkdir game
cd game
earwax init (initialises default files and directory structure)
earwax createmap "Scarry Forest" (creates a new map called Scarry Forest)
earwax maps (shows a list of maps with indices next to them)
earwax configuremap 1 --name "Scary Forest" (rename the first map because we spelled the name wrong)
earwax build 1 (open a GUI that allows you to use arrow keys to move around a map and place things from menus)
earwax surfaces (shows a list of added surfaces)

Surfaces dictate what sound will be heard when moving around maps. There will be a default surface for the map (which could be silent), and each "area" of the map can have its own surface.

You create them by dumping directories of sound files in the "sounds/surfaces" directory, which is created with `earwax init`. They should look like:

sounds:
    surfaces:
        concrete:
            concrete1.wav
            concrete2.wav
        sand:
            sand.wav

It will eventually be possible to configure the "actions" that are available on a per-level basic, so for example you could have a city map that's 2d where you can turn, and walk, and run, followed by a side scroller sewer pipe level where you can only move sideways and jump.

I'm thinking of making some kind of system where you can create variables with a command like `earwax global point int 0`, which - when coupled with a basic script builder - will allow you to do minimal coding in your games.

For anything not covered by the basic system (likely a lot), you'll be able to write your own Python, and the system will pull it in when creating a final script with a command like `earwax build`.

So there's my ideas so far. I'd love to hear what people think (the good and the bas), and as many suggestions as humanly possible.

I'm sure there's better ways to do what I want to do, so please feel free to be critical.

Thanks in advance for any and all feedback.

-----
I have code on GitHub

2020-08-30 02:03:17

So there's something really far down my prototype the things to see if they work list, but an idea I've been playing around with is actually describing maps in code.  For example:

town_square = Box(width=5, height=5, description="The town square")
fountain = EnvironmentalObject(position = town_square.bottom_left + v(3, 3), sound="fountain.ogg")
western_road = Box(width=20, height=1, description="The western road")
western_road.position(town_square.bottom_left + 3*y)

If you do some overloading of Python operators you can get nice vectors and things to work with, you can detect overlaps by just writing a 2d array and seeing if anything tries to set a cell twice, you can do things like verify_reachable(western_road, town_square) that will throw if it's not reachable, etc.  I don't know how far this goes, thus it being on my to prototype list, but writing something like this is intended to be the Synthizer demo/example project.

We need something better than tiles and grid editors, regardless, whether that's solved by you or not.  They work to a point, but there's such a big emphasis on to a point.  Json and yaml and whatever else editing is too rigid--you can do it but yoi have to work out the coordinates in your head.  When I think about even doing something as complicated as Swamp's most basic maps with the kinds of approaches we currently take I die a little inside, let alone doing (say) a proper small town.  With the grids you can either have giant boxes (in which case your roads are cathedrals) or small ones (in which case it's 200x200) and just, there has to be better.  SO, have my idea for better, maybe you'll make something of it.

My Blog
Twitter: @ajhicks1992

2020-08-30 02:39:14

@16
I like the look of this code!!

Can I ask, what is wrong with tile editors? I mean, if I let you chuck a static ambiance at 5, 2 for example, or create a surface that runs from 0, 0 to 18, 2, why is that not a good thing?

Not saying you're wrong BTW, just interested to see why you think having everything in code is better.

Only advantage I can see - and it's a pretty big advantage - is you could do (extending your code):

@town_square.on_enter
def event():
    """Make the town fool jump out in front of you."""
    #...

Are there other advantages I'm missing?

I've not exactly got a wealth of level editing knowledge, so I'm interested in and open to all approaches.

-----
I have code on GitHub

2020-08-30 03:07:43

@17
Suppose that you decide you want to do grid tiles as 1 foot, which is a reasonable-ish choice for anything inside a building, and ironically somewhat better than meters because 1 foot is about 1 footstep.  If I had to estimate, one floor of my apartment building would be something like 100 by 40 tiles, a very large supermarket is probably 200x200 or so, a city block is easily 500x500.  Arrowing over a grid at those sizes is painful, but more to the point it's also kind of incomprehensible without further description like shades of doom has, "You are in isle 5", "There is a passage to your left", etc.  You also have the problem that yeah, ambiance from 10 to 20 x and 5 to 15 y isn't so bad, but what about when it's 273 x to 279 x?  Good luck reasoning that out.  I call this the spreadsheet problem, because it shows up with any sufficiently large grid, whether that be a game map or a data table or whatever else.

But the second problem is, suppose you want to make a row of offices in an office building.  DO that with yaml and you cut/paste it.  Do that with the grid editor and you're there all day.  Do that with a function and a for loop and it's done, plus also you can edit one of them and all 10 update properly.

But again, I haven't done it.  There's drawbacks.  For example I suspect that you end up with environments that look like a bunch of hallways with dead ends, because that's easy to express when you can just main_hallway.north_exit or whatever else and build off  the previous piece.  But I think that the flip side is that if you ever wanted to build an actual, to-scale city or something like that, things that are bigger than what most audiogames end up with, you need something like this.  I've probably alluded toward my end goal being an MMO; one of the key steps in that, for me, is finding out if I' right about whether or not this can work.

There's a lot of other directions you can go, as well.  For example, if you have terrain types, you could make two of those terrain types sidewalk and street.  Then you could let the user define rules for overlapping, the default being error.  But a perfectly reasonable rule to add here is sidewalk + street = crosswalk, sidewalk plus sidewalk mean "corner of main street and 1st avenue" or whatever, and then you can just throw streets down like that and have a well-described neighborhood or what have you.  There's also much more hypothetical things like bringing in constraint solvers (see cassowary for an example) which would, arguably, let you have auto-fitting hallways and things like that too that just always connect two points.

I'm not sure I'd go trying to attach scripts in the map files themselves, though that's not a bad idea, just an implementation problem.  Writing something that compiles code like this to a 2d tile grid is actually really easy, but it's also potentially slow enough that you're going to want to load the map without having to recompile it every time, and if the only way to get the scripts attached to the objects is to build the map, that's kind of a nonstarter.  But you could probably solve this with some sort of stable identifiers an just not rebuilding the tile grid if you see one cached, or something.  I dunno.  My plan for the long term was to use Lua and have separate files, being as the goal is an MMO and you need a trusted language to stop everyone hacking the server when building areas, and also because one file per scripted object that's just object-id.lua is also not really super bad.

There's a lot of ergonomics and usability stuff that needs designing, like how do you specify positions of objects relative to each other, and how do you easily encapsulate things into functions, etc, that I have ideas on but who knows how good those ideas are.

One of the key difference between audiogame maps, both what people have done and what people would like to do, and sighted game maps, is this.  Sighted game maps don't have metadata layers.  This seems kinda like I'm changing the topic, but I'm not: we also need good ways to handle that aspect.  Sighted tile-based game is you drop some road tiles, but audiogame is also you need to be able to say this is 4th street or whatever.  You're also building a GPS system in, basically, with all the GPS stuff.  I don't think anyone's taken that as far as we could.  And on the whole, proposing this kind of thing, I'm really surprised that no one's just said "let's use a programming language and make it nice to use", it's always "My tile editor but better".  I wonder if there's an actual reason for that, I dunno.

My Blog
Twitter: @ajhicks1992

2020-08-30 03:42:16

Tile editors and stuff work, but none of them that have ever existed that I've tried have done it well imo. They're always missing a huge piece.

Facts with Tom MacDonald, Adam Calhoun, and Dax
End racism
End division
Become united

2020-08-30 09:40:36

In the prototype of a building game I was making a while ago, I designated the map sintax to be composed completely by javascript callables
So the server would expose objects to the javascript parser, and you could do something like the following>
set_name("city")
set_maxx(500)
set_maxy(500)
set_maxz(500)
add_tile(0, 500, 0, 500, 0, 0, "dirt")

The reason I implemented it that way was because I eventually wanted to allow the map tiles to be bound to events, so you could have in game scripting.
I know this is not exactly what you've been talking about, but perhapps, this is something else than lua  that's worth considering?
The library I've used is [
this one

Paul

2020-08-30 12:09:15 (edited by chrisnorman7 2020-08-30 12:57:39)

@19
What piece is missing?

@18
I'd be lying if I said I understand your whole post. I'm going to read over it a few times to fully grasp the stuff you're on about (I've never heard of Cassowary for example), and I also think there is a big part of this that involves me analysing my own feelings.

My instant response is "but a tile editor lets everyone make games and a solution that involves code raises the entry requirements in a way I'm not entirely comfortable with". I do stand by that, and my eventual solution was always going to be a rudimentary compiler of sorts: It'll take the objects created by the tile editor and turn them into code. In fact the whole of Earwax's building systems will work like that.

You'll make your game and levels ETC, then the `build` command will turn them into:

from earwax import Game, GameLevel

game = Game()
level_1 = GameLevel('Forest', game, id='asdf;lkj')
#...

levels = {
    'asdf;lkj': level_1,
    #...
}

So there'll be no runtime parsing of anything. You'll just end up with a probably ugly - but hopefully working - python file you can run with `python game.py`.

Also eventually a `compile` command that'll build, then run pyinstaller and pass it all the assets from the sounds folder ETC.

Anyways, I'm digressing.

I'll have a bash at your solution, if you don't mind me pinching the premise (crediting you of course)? I'll see how far I get, and hopefully by the time you want to create your MMO, most of the building system will be already written.

What do you think of the idea of your Box class et al being put into a separate Python package? Maybe I'm not thinking through this enough, but it would seem if it's a system we both intend to use, it would be silly to write separate implementations. Plus, that gives you the advantage that - way down the line - people could use Earwax to build local versions of maps they chuck to your MMO for inclusion.

With ambiances, do you have a suggested solution? I mean it would seem to be a problematic one, because the ambiance will have to either emit from all 4 corners of the box (might cause phasing issues), or you'd need to calculate the nearest coordinate on the ambiance grid to your player.

-----
I have code on GitHub

2020-08-30 16:39:48

@19
I used to think like that.  I even had ideas on better tile editors.  But I think that the piece that's missing proves to be sight, in the end.

@20
I'm speaking in a programming language agnostic manner, though it is much easier to come  up with something usable if you have operator overloading in my opinion.

@21
I can't use Python.  I'm also not saying you shouldn't.  My plan was to prototype this in Python, then write a better version using Lua for the MMO.  If you're going to run something multiplayer, you can't use Python because Python can't be sandboxed, which means that you had better 100% trust all your builders not to do anything malicious, and that's just not realistic in practice.  But it's easy to prototype in Python, and if you're not going to be doing an MMO where builders upload directly then it's fine.

I don't know what you want from ambiances.  When I hear ambiance, I think music or background wildlife soundtrack that's just a stereo file. If you want to specifically place them you could do that, but in practice even fixed ambiances are going to need things like occlusion if they're not always just going to suggest an open passage, and somehow you have to get from the mono, panned version to the stereo version when the player enters the area.

I'm not sure that this raises the entrypoint.  In practice, people who don't know how to code can treat it like a data file and just ignore all the coding features that are available to them.  I think that the other open questions with doing something like this are more important than that.

Regardless of whoever tries it first, my interest at the moment is finding out if it's workable.  I expect that there'll be some sort of prototype V1 that determines that and then gets left behind, and a better V2 that people actually like using.

I'll leave packaging decisions up to you.

My Blog
Twitter: @ajhicks1992

2020-08-30 16:46:12

@22
OK, I've started creating an implementation inside of Earwax, since that's the directory I'm working in ATM. Means I don't have to upload stuff to PyPi or `pip install -e .`.

I'll see what happens when I build some maps with it, hopefully this afternoon, maybe upload a couple of examples.

There'll still be a tile editor that people who don't want to use Python can use, but they'll have to compile that work into a Python file. That compilation will likely be one way, since I don't want to much about if people subclass `Box` or anything. Best of both worlds I reckon.

Thanks for all your help.

-----
I have code on GitHub

2020-08-30 17:40:02

No one ever thinks to give tools to create interesting features, it's just enter numbers. That's fine, it can be done, but really why do it that way when literally every game since games allowed you to build things lets you do it through use of painting tiles on or dragging out lines and boxes.

Games like Transport Tycoon allow you to drag out your road system. Others like Sim City let you make whole entire zones with one box. The road system is ghost imaged onto the map as you drag, then you release and it is cemented. The construction workers come in and you see it built realtime.

But really, what's missing is the power to make large scale changes quickly by letting us make selections and have tools that fill them in with whatever it is you want to build. Also the example given in a previous post about looping through to make parallel hallways or whatever that way ( read it last night ) can easily be done with a copy or duplicate option.

Let's say I wanted to make four parallel hallways and then join them together with another section of corridor that runs at a 90 degree angle with them at one end. The workflow could look something like this. Cursor over to where you want the first hall to start, then hold shift and move the arrows to drag out a rectangle. You can tap or hold, and each time the selection changes, a small click can be heard which indicates this. Let go of shift once the height and width match what you want them to be, or tap control to have the whole thing canceled and start again. Once you've got your first box, there should be a command to mark it for duplication, use it, then move back to the start of it and use either up or down arrows to select a point vertically and hit the key that performs the duplication. Repeat until you have four in total, then go to the end of one of them and make a box back to the first. Since it passes through each of them, it now connects them.

This is why I do not think making good map requires coding. Of course, it's an option for those who want to do that, but if the right tools were developed, you would be able to mock up your map in short order with minimal effort.

Facts with Tom MacDonald, Adam Calhoun, and Dax
End racism
End division
Become united

2020-08-30 17:57:38

@24
I understand that, but it's more complicated when you start having to modify what you've already placed, and even more complicated than that if you walk away and come back.

My fundamental objection to tile editors is that there's nothing to "look at".  Even if you make "Feeling" it as efficient as the BK3 camera, you can't just glance at it and go "yeah this is an office block and here are the offices".  So fine, now you do text descriptions and notes for yourself and bookmarks and...where does it end exactly?  We haven't even gotten shades of doom style navigation into that yet, do you really want to have to manually tag every intersection by hand?  I don't.  But more to the point, eventually learning the tile editor is as complicated as learning Emacs or something.

The downside of my approach is that things like accidental overlap and such are a bit easy, to do, but you can warn against that, and you have the semantic information necessary to figure out what the original goal/intent was.  The hypothetical office block would be 30 or 40 lines for the entire level at most.  My big open question with it is: yeah, office blocks are easy, but what about the ancient jungle of doom?  Office blocks are always easy in anything, it's just a good starting point to figure out how expressive something is, in that if doing office block in it is hard then doing anything else in it will be impossible, it doesn't really say whether it's good.

Maybe in the end, all map building sucks and the best we can do is a really, really good tile editor.  I don't know.

I should also stress that I think that this conversation has gotten to "and then there was a Box class".  That's not the kind of thing I mean, just the first piece of it.  Like, for example, the Corridor class might incorporate the walls of the corridor and have an add_exit function to let you stick named exits on it.  That's where the beyond a tilemap power starts coming from.

But: as I've said, I don't know if it works.  It sounds like I'm saying that I'm sure it works, I think.  I don't want to leave anyone with that impression.  It's just on my find out if it works list, especially since coding this is actually easier than coding a very in-depth tile editor.

My Blog
Twitter: @ajhicks1992