News for hackers. Stuff that matters.
Re:Ask HN: Favourite open source game? by flashgordon on Thursday June 02, 2022 @02:13AM (#31591942)
Apologies in advanced for not submitting a game. Does anybody feel an unbreakable urge to just break from free of the dreary day job and write games for fun each time you see a HN post like this? My fantasy is to just go and Browserize a game (and not just by wasming it). Gaaaaah the tragedy of limited time!
Re:Ask HN: Favourite open source game? by Tade0 on Thursday June 02, 2022 @03:02AM (#31592252)
Yes and yes.

I've been trying write a game from scratch (emphasis on "scratch" considering the scale of the itch) as a side project, but that quickly evolved into an excercise in overcoming analysis paralysis.

I'm currently stuck on "can I count on the HTML Canvas to optimise cases where a tile is out of view or should I make a fancy system to calculate that now?"

I get an average of 2h a week to do this, so I need to be really careful not to go into one of the many rabbit holes there.

In any case I recommend Entity Component System as an architecture for games. You can write 20 lines of code at a time and still make demonstrable progress.

Re:Ask HN: Favourite open source game? by hutzlibu on Thursday June 02, 2022 @04:12AM (#31592608)
"I'm currently stuck on "can I count on the HTML Canvas to optimise cases where a tile is out of view or should I make a fancy system to calculate that now?""

I am not sure if I understand you correctly, but since I did wrote a canvas game from scratch, I can tell you that you cannot count on the canvas to optimize anything (and likely not what you want in this case)

Every browser does it a bit different and it will depend on the hardware and OS what optimisation features are avaiable.

On average the canvas is quite performant, though.

Performant enough, that in my case, I draw everything on a big map - zoom in and then move the map around, when the player moves.

On a gaming PC, maps can be quite large - but on an average mobile not so much.

But I autogenerate the levels which means I can dynamically adjust size, so this works for my game.

But in general yes, you want a small canvas, the size of the screen - and then only draw what is needed.

EaselJS may help with that. It is basically flash on the canvas, but does exactly this. You put all your graphic objects on the stage - and easelJS will figure out which one of those needs to be drawn at the current frame. I initially used it, but not anymore as it was not optimized for my use case, making LOTS of new draw calls on the map every tick. But for a classic game with limited entities, it is very performant.

Re:Ask HN: Favourite open source game? by flashgordon on Thursday June 02, 2022 @01:52PM (#31598258)
I also found Canvas a bit challenging - not the programming model per day but just the work of coordinating scenes and objects. I got overwhelmed with the number of frameworks at the time and didn't want to go down the path of investing in a single one (not a good move in hindsight).

By the way I wonder if it is reasonable to expand the "requirement" to - wasming is ok if you are writing the game from scratch in say rust instead of just compiling old binaries to wasm?

Re:Ask HN: Favourite open source game? by Tade0 on Thursday June 02, 2022 @05:53AM (#31593101)
> I am not sure if I understand you correctly, but since I did wrote a canvas game from scratch, I can tell you that you cannot count on the canvas to optimize anything (and likely not what you want in this case)

Bad wording on my part. I noticed somewhat of a performance difference when drawing an image at coordinates that are outside of the canvas boundaries and was wondering if the scale of this is significant.

Do you have the source of your game published anywhere?

Re:Ask HN: Favourite open source game? by hutzlibu on Thursday June 02, 2022 @06:06AM (#31593168)
"I noticed somewhat of a performance difference when drawing an image at coordinates that are outside of the canvas boundaries and was wondering if the scale of this is significant."

You mean you have a canvas of 1000 px size and make a drawImage at x> 1000?

Well in that case the image does not get drawn at all, so most browsers should indeed be more performant by ignoring this call. But there might still be a overhead of loading the image, so I would check the boundaries and not make that call, if it is not necessary.

(The canvas itself is just a large array of numbers after all. And if you do not manipulate that array when your new values are outside of that boundary, nothing happens. And a image is usually just a pointer to another large array/blob, so if the browser is smart, it does not load that array, when it finds out it does not have to)

"Do you have the source of your game published anywhere?"

Unfortunately not yet, but soon I will release. I hope.

Re:Ask HN: Favourite open source game? by vyrotek on Thursday June 02, 2022 @02:44AM (#31592157)
All the time. I get the itch every few months. Luckily my day job is all C# so I've been able to pick up Unity on the side.

I'm terrible at making games but working on them brings back the joy I had when I first learned to program. The feedback loop between code and something interesting on the screen is quick and refreshing. Lately I even managed to make a basic VR game with my Quest2.

Re:Ask HN: Favourite open source game? by mnahkies on Thursday June 02, 2022 @07:57AM (#31593762)
I don't suppose you would have any good tutorials / resources for quest 2 development with unity. I've had a brief go recently but as someone who's never used unity before I found myself floundering a bit.

I've also found the unity editor to be pretty unstable on Linux so if you happen to have any tips there I'd be all ears

Re:Ask HN: Favourite open source game? by cableshaft on Thursday June 02, 2022 @10:24AM (#31595295)
I just went through some tutorials a couple of months ago and had some good luck with this series by Valem on Youtube[1]. It's from 2020 and a bit outdated in a couple parts (like I think the input system changed in more recent Unity versions, but you can select the old version, it just has different names, and also I think some of the links for the controller assets were broken somehow, but I was able to download a package that had them I think), so read the comments near the top, which show timestamps and where things might be different now, but overall I was able to get things working fine in my Quest 2 device.

I was also looking for books, and the Unity 2020 Virtual Reality Projects Book[2] looks promising, and I just got a used copy (still being sent to me). Again since it's from 2020 there might be a couple things out of date, but it looks like it could be worth it.

I use Unity in Windows so I can't help on the Linux front.

Good luck! You can ping me if you get stuck somewhere, I might have had the same issue and might be able to help you get unstuck.

[1]: https://www.youtube.com/watch?v=gGYtahQjmWQ

[2]: https://www.amazon.com/Unity-2020-Virtual-Reality-Projects/d...

Re:Ask HN: Favourite open source game? by sassy_quat on Thursday June 02, 2022 @03:42AM (#31592449)
I just want them to be done programming FPS games, employ all artist graduates, and have them design textures and models for an open source FPS game.
Re:Ask HN: Favourite open source game? by Feneric on Thursday June 02, 2022 @09:06PM (#31602922)
Definitely. I slake my thirst for game dev by creating games in between job contracts as well as on some weekends. I've written a few interactive fiction pieces, but my most downloaded titles are in the category of retro RPGs in the style of the old 8-bit Ultima games (as found on the C64/128, but playable on modern hardware). It's admittedly a niche. They are Minima https://feneric.itch.io/minima and Anteform https://feneric.itch.io/anteform and are both open source.
Re:Ask HN: Favourite open source game? by flashgordon on Thursday June 02, 2022 @11:58PM (#31604114)
Holy crap these are amazing. Good on you mate. I wonder if there is some kind of game dev guild for folks who want to just get together for a weekend hackathon and build games/engines!
Re:Ask HN: Favourite open source game? by Feneric on Friday June 03, 2022 @08:22PM (#31615518)
Thanks! I don't know of anything exactly like that, but there are plenty of hackathons and the like that are similar. It's not to hard to sit down with the docs and/or tutorials for systems like Godot, Inform 7, Ren'Py, etc. and put something basic together. Expect to throw away your initial one or two projects, but after that you should be good to go. I built Minima & Anteform using PICO-8, a virtual console. The RPG game system they use I had to build from scratch first. For me it was mostly a challenge to see if I could fit that much gameplay and story into the available footprint, but if you're starting out with one of the systems I mentioned it should be a lot easier. Also, don't get discouraged if you seem to be "almost done" for a long time. It often takes as long (or longer) for the last 10% and polish than it does for the initial 90%.
Re:Ask HN: Favourite open source game? by spacetraveler11 on Friday June 03, 2022 @10:52AM (#31609096)
Yes, in fact it's what I've been doing the past few days. Luckily there's a long weekend coming up with lots of free time for me to work on it: XBattle style game rewritten in Unity. Plan is to get a basic version browserized so I can get some feedback from players. My list of features I want to add is already starting to grow exponentially (e.g. persistent multiplayer world: hop on to play the game whenever you have time, then leave your troops in a defensive position and hopefully nobody is able to break your defense while you're not playing ^^).
Re:Ask HN: Favourite open source game? by Bouncingsoul1 on Thursday June 02, 2022 @10:11AM (#31595115)
Yes all the time, my go to topic for learning new techs is usually hexes (I don't know why I'm obsessed with HexMaps...). Anyway when I dabbled with F# I did exactly this, browserize it with Fable(https://fable.io/). Usually I loose interest after a while so I implemented HexGrids + some strategy/tactical stuff on various techstacks, but never finished anything. It's ok its more about learning the stack than actually releasing.
Re:Ask HN: Favourite open source game? by msmenardi on Thursday June 02, 2022 @01:56PM (#31598297)
I also love hexes. Have you seen this guy's blog before? It's a treasure:

https://www.redblobgames.com/grids/hexagons/

Re:Ask HN: Favourite open source game? by BlueTemplar on Thursday June 02, 2022 @03:41PM (#31599617)
Thanks a lot for this !

Another, way more generalist source for tilings :

http://www.roguetemple.com/z/hyper/geoms.php

Re:Ask HN: Favourite open source game? by pid-1 on Thursday June 02, 2022 @08:14AM (#31593890)
Start doing that in your spare time. You will likely find that write your own game is way more dreadful than your day job :^)
Re:Ask HN: Favourite open source game? by Abimelex on Thursday June 02, 2022 @04:41AM (#31592733)
I indeed played with the thought to "browserize" OPENTDD. Similar logic, but real time, everything slower, so you can built and earn money only very limited. So that a Game could last like a year or so and playing a few minutes per day would be enough.
Re:Ask HN: Favourite open source game? by brenainn on Thursday June 02, 2022 @03:45AM (#31592458)
Oh yeah, I keep telling myself I'm going to work through the raylib tutorials at some point. Still hasn't happened. Probably doesn't help I play games in that downtime instead of thinking about making them.
Re:Ask HN: Favourite open source game? by AnIdiotOnTheNet on Thursday June 02, 2022 @10:31AM (#31595350)
Yes, but my experimentation with game development has shown me that I am no good at making games that are actually fun to play or indeed interesting in any way, so I don't quit my day job.
Re:Ask HN: Favourite open source game? by wsc981 on Thursday June 02, 2022 @07:39AM (#31593671)
Yeah I dabble a bit in game dev every now and then. Released 2 small games, but nothing spectacular. Gonna keep at it whenever time allows, more fun than my day job ...
Re:Ask HN: Favourite open source game? by flashgordon on Friday June 03, 2022 @12:01AM (#31604131)
Nice. Is it possible to get this monetized? Not necessarily for the financial reward but for the publicity/accomplishment feel?
Re:Ask HN: Favourite open source game? by wsc981 on Saturday June 04, 2022 @12:08AM (#31616883)
Just a few US dollars total over the course of last year. But perhaps in the future I might get lucky ... And either way, it's fun to work on games regardless ...