News for hackers. Stuff that matters.
Re:The unreasonable effectiveness of declarative programming by ggambetta on Tuesday May 19, 2020 @04:53AM (#23232766)
Back in the day when I was making videogames (http://www.mysterystudio.com), I implemented something similar for my framework.

Most of the framework was declarative. There were Sprite objects that had an associated Image and a position (among other things). The onUpdate(dt) method of the "screen" didn't explicitly draw things on the screen, it only updated positions and other attributes of the Sprites, and the renderer would do the rest (back in the days of software rendering, it updated only dirty sections of the screen, etc).

Still, making programmatic animations was difficult, and for videogames you want things to look very nice (smooth movement, easing in and out, transparency effects, that kind of thing). There was a lot of { srcX, srcY, dstX, dstY, time } sets, for every thing that moved.

At some point I had an idea similar to what this blog proposes. I called them SpriteControllers, and they could be "attached" to a Sprite. The engine would call each SC's onUpdate(dt) method on every frame, and the SC would change the position, rotation, alpha, or tint of the Sprite.

By default all the attached SCs would work in parallel, so the next step was to have a SCSequence to run things in series. Also each SC was allowed to declare when it was "done". Some did (like linear motion from A to B), some never finished (like a pulsating glow).

It was a fun development in the sense that it made something that was very difficult to do by hand surprisingly easy, and took our games to the next level in terms of visual quality, just by adding a bunch of very short classes.

Making games was fun in a way. Alright, back to work. These protos aren't going to copy themselves into other protos by themselves!

Re:The unreasonable effectiveness of declarative programming by OliC on Tuesday May 19, 2020 @05:39AM (#23233018)
My friends and I love playing "Murder, She Wrote" on a big TV screen during downtime at LAN parties. We streamed it on Twitch for a while. We're big fans, great work!
Re:The unreasonable effectiveness of declarative programming by ggambetta on Tuesday May 19, 2020 @07:01AM (#23233508)
OMG, seriously? You made my day <3

Try the two Sherlock games if you can get them somewhere - these have a special place in my heart :)

Re:The unreasonable effectiveness of declarative programming by tluyben2 on Tuesday May 19, 2020 @10:06AM (#23234993)
Do you know where to get your games still? My wife would like them... The reason you are not just putting them on archive.org is because of the contracts you had I guess?

Edit: read your other comment and saw the licensing stuff... Shame about games (and such) that you just cannot keep them for sale forever... But just let them die.

Re:The unreasonable effectiveness of declarative programming by ggambetta on Wednesday May 20, 2020 @03:48AM (#23244366)
Looks like Big Fish Games still sells them: https://www.bigfishgames.com/games/2452/the-lost-cases-of-sh...

Never thought of putting our first-party games on archive.org, sounds like a great idea, I'll look into it :)

Re:The unreasonable effectiveness of declarative programming by OliC on Tuesday May 19, 2020 @12:10PM (#23236466)
Absolutely! I'll definitely do that!
Re:The unreasonable effectiveness of declarative programming by Folcon on Tuesday May 19, 2020 @09:21AM (#23234565)
I've got to ask, for stuff like "Murder, She Wrote", did you license anything? If so was that hard and what was the process like?
Re:The unreasonable effectiveness of declarative programming by ggambetta on Tuesday May 19, 2020 @09:30AM (#23234656)
For MSW, CSI:NY, Sherlock, and others, we were working with a company in LA called Legacy Interactive. Technically, these are "their" games, we did exclusively all the programming and scripting. They got the licenses for the TV properties, commissioned the art, and wrote the storylines. So unfortunately I can't comment on the licensing process, as I wasn't involved :(
Re:The unreasonable effectiveness of declarative programming by Folcon on Tuesday May 19, 2020 @07:32PM (#23241585)
Still really cool =)...
Re:The unreasonable effectiveness of declarative programming by moljac024 on Wednesday May 20, 2020 @03:05PM (#23250506)
Funny thing, I'm working on a game right now, using react and pixi.js and I implemented something very similar to what you're describing here! It's been fun so far