frontpage.
newsnewestaskshowjobs

Made with ♥ by @iamnishanth

Open Source @Github

fp.

Open in hackernews

I'm Making a Small RPG and I Need Feeback Regarding Performance

https://jslegenddev.substack.com/p/im-making-a-small-rpg-and-i-need
35•ibobev•2h ago

Comments

calebjmatthews•2h ago
Just downloaded and tried it on my M1 Mac and the performance was what I'd expect for a game like this, both in and out of battle. Totally smooth and ~15% of CPU usage in both cases. By the way, I love the pixel art, and the gameplay has potential, it's a style I've never personally played before but I could see it being compelling.
BugsJustFindMe•2h ago
> is it just my machine? I’m using a Macbook Air M3 with 16GB of RAM

Using one of the singularly most powerful personal computers ever made. It's probably not the machine if they don't notice everything else being unexpectedly bad too.

Lord-Jobo•1h ago
Well. That’s a bit misleading.

A real example: MacBook Pro m4 will have absolutely god awful performance on certain web based games * (compared to windows or even android), regardless of the browser or any browser performance settings. This is not the hardware explicitly, obviously it’s a very high performance chipset, but it’s definitely the hardware in terms of what the OP is asking. Because that particular hardware is falling down all over the place in this scenario when others are not.

Fixing it? Sure that’s almost certainly on the games side, some kind of inefficient process or element that doesn’t work right in that environment and needs to be hammered out or replaced.

But for diagnosis? Yeah, “it’s the hardware” is the right answer. And you can’t fix it without diagnosis.

*replicated on latest chrome, Firefox, safari, and Brave, with the games: Idlescape and (now dead)osrsIdle ~8 months ago

jesse__•1h ago
> Well. That’s a bit misleading.

Uhh .. wut?

The game appears to be similar to a point-and-click adventure game, which were popular in the 80s, and ran just fine.

In 1988, a CRAY Y-MP supercomputer had "64 megawords of memory". I have no idea how large a word was on those machines, but by todays standards, that means 128MB. Let's go with that. The Y-MP was the size of two massive fridges.

Now, the Macbook air OP owns, which is smaller than a toaster, has 128 TIMES as much memory in it as a supercomputer did back in 1988. Similar story for processing power, storage, etc. Point and click adventure games haven't changed all that much, and even back then didn't require a supercomputer to run.

> But for diagnosis? Yeah, “it’s the hardware” is the right answer.

Given the above, how you came up with this is beyond me.

moron4hire•30m ago
No, it's true. There can be defects in the graphics driver that make certain, specific functions in GLSL or WGSL either completely broken or woefully inefficient.

It can be very dependent on hardware generation, too. One of my past projects was a very simple, photosphere-based learning environment. Photosphere rendering is incredibly simple. But on Intel processors with Iris Xe integrated GPUs used by one particular year of iMacs (I don't remember which, it only impacted 2 users and it was several years ago), I couldn't use the standard cube sampler because it was just broken. I had to split my photospheres into 6 cube faces and render 6 quads separately to be able to use the not-broken 2d sampler. The issue didn't appear on any other generation of Iris Xe on macOS and it didn't appear on any generation of Iris Xe on any other OS. It was very specifically the combination of macOS and that generation of GPU.

shkkmo•17m ago
> There can be defects in the graphics driver

Which is software, not hardware. Just not the software written by this dev.

SAI_Peregrinus•30m ago
Cray Y-MP had a 64-bit word size. They came with 32, 64, or 128 MWords. So 256, 512, or 1024MiB.
aleph_minus_one•1h ago
> > is it just my machine? I’m using a Macbook Air M3 with 16GB of RAM

> Using one of the singularly most powerful personal computers ever made.

Some arbitrary PC Master Racer: "Hold my beer, and I will show you a powerful personal computer." :-)

mvkel•1h ago
> performance issues

What kind? It would be helpful to know what you're experiencing, attempts you've made to fix, etc.

Or is this a thinly veiled "I've been working on this for a while and it's taking longer than I thought and want some encouragement." Which is fine! It's a great thing to ask for.

duttish•1h ago
Do you have a profiler at hand?

If you have a friend who is encountering the performance problems enable profiling report export and ask them to send that over to you. Hopefully that'll show you what is taking so many cycles.

b1tshift•1h ago
On an M2 Mac with 24GB the game went smooth for a few fights and then went down to around 10fps and got slower with every attack an enemy did in the fight. The longer I played the slower it got. CPU and memory usage was stable all the time.
doyougnu•1h ago
Not a game dev. Besides profiling, I would create game scenarios that exercise certain parts of the game engine.

For example, I would create a game fight scenario where the player has infinite health and the enemy just attacks super fast at some settable rate. That way you could monitor whats happening in extreme abnormal conditions with the hypothesis that if the game works in extreme conditions then it will work in normal conditions.

Another example. If you have random encounters like in old school JRPGs then I would create a scenario where a fight happens per step of the player, the fight loads, then the enemy immediately dies, rinse wash and repeat. That should allow you to asses how the game performs after 100s of fights quickly.

The idea here is to create tests that improve your signal to noise ratio. So you create a scenario that will create a large signal so that then you can more easily diagnose the performance issues.

whizzter•1h ago
Sounds like the culprit though, could be tons of small objects added for effects or something that still don't show up in memory usage but adds iteration time?
svnt•1h ago
This is the future of troubleshooting: where did the LLM decide to introduce recursion based on calculation that draws on an otherwise unused global counter and a separate timer initiated at launch for absolutely no reason.
godshatter•25m ago
It can't be hardware, as others have noted these kinds of games have been working great on machines that are magnitudes slower than the OPs machine. Maybe it's some kind of search that is running linearly on an assumed small dataset and it gets bigger than imagined, instead of it running a binary search or something. Maybe some of the data is unreasonably large for what it contains and can't get cached as easily.

And, as others have mentioned, if you really want to know, profile.

magicmicah85•1h ago
Without downloading the exe (work laptop right now, can try later), have you followed the optimization suggestions in KAPLAY's guides?

https://kaplayjs.com/docs/guides/optimization/

Assuming it's capable of running in your browser, I'd suggest using chrome's dev profiling tools to help with finding the optimization areas. Based on feedback from everyone else, sounds like something is not cleaning up as the game keeps running.

sionisrecur•1h ago
I'd suggest getting a SteamDeck and use it as the lower limit on performance. If it runs there, it will run everywhere else.
VegaKH•1h ago
Here is my crappy, not finished game that maybe will run fine or maybe not. Could you please do some free testing for me, and optimally do a screen recording showing performance and send it to me along with your notes?

Here is the link to where you can download it, and also maybe, you know... PAY FOR IT? These broken unfinished games don't make themselves, you know.

petercooper•1h ago
This is absolutely fine for someone to request on their personal blog to a group of followers who may well be interested in the game and support the author. People have used their blogs for this sort of thing for decades.
gwbas1c•1h ago
Why are you worried about performance for a 2D game that's basically moving a few sprites around the screen? A game like this shouldn't be taxing for modern hardware; and should even run cleanly on pretty much any computer made in the last 15-20 years. (Or even older, if you weren't using Javascript.)

As some of the other comments imply that there are some performance issues; more than using a profiler, I would make sure that your mental model of the event loop from your framework is correct. If all you're doing is moving some sprites around the screen, you need points where your code pauses because it has nothing to do. This could either be awaiting something from the framework, or putting most of your logic in callbacks that are triggered by the framework.

A different way to say it: Between frames, there's not that much calculation that your game needs to do when you're just moving a few sprites around in 2D. The event model that you hook into should be something where your game does its calculations, and then waits between frames.

lloeki•53m ago
> Why are you worried about performance for a 2D game that's basically moving a few sprites around the screen? A game like this shouldn't be taxing for modern hardware

> As some of the other comments imply that there are some performance issues

Because there's nothing implied and they experience perf issues first hand? TFA:

> I’ve been experiencing performance issues

> I’m using a Macbook Air M3 with 16GB of RAM

jesse__•1h ago
First off, yay for making games! I love working on games, and have spent many, many hours doing it, so welcome to the club :)

Second, let me introduce you to my good friend, the profiler. A profiler is an absolutely indispensable tool for making games. Find one that you like, and learn to wield it with laser-guided precision.

Generally, there are two things you want a good profiler to tell you about; execution speed, and memory. Finding a profiler that tells you about execution speed is pretty easy (basically all of them at least nominally do that), and finding one that also profiles memory (in a useful way) is somewhat harder. I'm not sure of the state of profilers for Javascript, but maybe the tool you're using (KAPLAY) has one built-in?

From my long-forgotten days of programming javascript, one thing you want to look out for (which is difficult to spot without a profiler), is creating memory leaks. Memory leaks in Javascript can be a double-edged sword; you're both using more memory than you should, and the garbage collector has more pressure on it. Over time, this can bring an application to a crawl as the GC spends more and more time traversing leaked objects.

Good luck friend. It's dangerous to go alone, take this :sword:

lukan•56m ago
A bit offtopic, but if it would have been playable in the browser I would have tested it, but I don't want to download and install a (for me) random exe.

(and I don't see how performance could be an issue unless a major screw up, but like others have said, use a profiler. Sounds like memory leak from what others have said)

DeathArrow•43m ago
If it wasn't for Javascript, that kind of game should have been able to run on a 2Mhz 8086 and 640kb of RAM.
yomismoaqui•37m ago
Forget about performance, specially in a 2d game like this one. Focus on making it fun (really-really fun is possible).

I have played games that didn't performed so well because they were so fun. Games are about fun, anything else (narrative, performance, sound...) is secondary.

debo_•31m ago
If frames are dropping, it's likely not fun.
xantronix•36m ago
Related to the initial poor performance of Electron on macOS Tahoe?

https://github.com/electron/electron/issues/48311

butz•16m ago
You can use developer tools in the browser to simulate slower CPU. Use performance profiling to find which functions are taking up the most time. Try switching to battery saving mode, it might throttle your CPU a bit too. If you really want to dive deep in performance improvements, you should purchase lowest end laptop with integrated GPU, if budget allows. And how about providing an embedded web version of your game, because downloading unsigned executables these days should be considered a no-no.

Leaving Meta and PyTorch

https://soumith.ch/blog/2025-11-06-leaving-meta-and-pytorch.md.html
533•saikatsg•10h ago•118 comments

I Love OCaml

https://mccd.space/posts/ocaml-the-worlds-best/
40•art-w•2h ago•8 comments

A Fond Farewell

https://www.farmersalmanac.com/fond-farewell-from-farmers-almanac
420•erhuve•13h ago•137 comments

OpenMW 0.50.0 Released – open-source Morrowind reimplementation

https://openmw.org/2025/openmw-0-50-0-released/
125•agluszak•3h ago•40 comments

PyTorch Helion

https://pytorch.org/blog/helion/
75•jarbus•5d ago•15 comments

From Memorization to Reasoning in the Spectrum of Loss Curvature

https://arxiv.org/abs/2510.24256
30•andy12_•3h ago•10 comments

You should write an agent

https://fly.io/blog/everyone-write-an-agent/
867•tabletcorry•19h ago•343 comments

Meta projected 10% of 2024 revenue came from scams

https://sherwood.news/tech/meta-projected-10-of-2024-revenue-came-from-scams-and-banned-goods-reu...
311•donohoe•3h ago•241 comments

Comparison Traits – Understanding Equality and Ordering in Rust

https://itsfoxstudio.substack.com/p/comparison-traits-understanding-equality
15•rpunkfu•5d ago•1 comments

A.I. and Social Media Contribute to 'Brain Rot'

https://www.nytimes.com/2025/11/06/technology/personaltech/ai-social-media-brain-rot.html
21•pretext•52m ago•13 comments

1973 Implementation of Wordle was Published by DEC (2022)

https://troypress.com/1973-implementation-of-wordle-was-published-by-dec/
35•msephton•6d ago•17 comments

Claude Is Down

https://status.claude.com/incidents/tgtw1sqs9ths
41•agrocrag•1h ago•28 comments

Two billion email addresses were exposed

https://www.troyhunt.com/2-billion-email-addresses-were-exposed-and-we-indexed-them-all-in-have-i...
548•esnard•20h ago•383 comments

Text case changes the size of QR codes

https://www.johndcook.com/blog/2025/10/31/smaller-qr-codes/
109•ibobev•5d ago•33 comments

Sweep (YC S23) is hiring to build autocomplete for JetBrains

https://www.ycombinator.com/companies/sweep/jobs/8dUn406-founding-engineer-intern
1•williamzeng0•4h ago

My Experience of building Bytebeat player in Zig

https://blog.karanjanthe.me/posts/zig-beat/
4•KMJ-007•3d ago•0 comments

We chose OCaml to write Stategraph

https://stategraph.dev/blog/why-we-chose-ocaml
78•lawnchair•3h ago•78 comments

Revisiting Interface Segregation in Go

https://rednafi.com/go/interface-segregation/
12•ingve•5d ago•6 comments

Show HN: I scraped 3B Goodreads reviews to train a better recommendation model

https://book.sv
499•costco•1d ago•201 comments

Is Software the UFOlogy of Engineering Disciplines?

https://codemanship.wordpress.com/2025/11/07/is-software-the-ufology-of-engineering-disciplines/
69•flail•3h ago•115 comments

Game design is simple

https://www.raphkoster.com/2025/11/03/game-design-is-simple-actually/
414•vrnvu•18h ago•131 comments

The Silent Scientist: When Software Research Fails to Reach Its Audience

https://cacm.acm.org/opinion/the-silent-scientist-when-software-research-fails-to-reach-its-audie...
56•mschnell•6d ago•30 comments

I'm Making a Small RPG and I Need Feeback Regarding Performance

https://jslegenddev.substack.com/p/im-making-a-small-rpg-and-i-need
35•ibobev•2h ago•28 comments

Analysis indicates that the universe’s expansion is not accelerating

https://ras.ac.uk/news-and-press/research-highlights/universes-expansion-now-slowing-not-speeding
217•chrka•19h ago•175 comments

From web developer to database developer in 10 years

https://notes.eatonphil.com/2025-02-15-from-web-developer-to-database-developer-in-10-years.html
129•pmbanugo•3d ago•49 comments

JermCAD: Browser-Based CAD Software

https://github.com/jeremyaboyd/jerm-cad
48•azhenley•11h ago•33 comments

Kimi K2 Thinking, a SOTA open-source trillion-parameter reasoning model

https://moonshotai.github.io/Kimi-K2/thinking.html
832•nekofneko•1d ago•373 comments

Machine Scheduler in LLVM – Part II

https://myhsu.xyz/llvm-machine-scheduler-2/
25•mshockwave•5d ago•0 comments

Lessons from Growing a Piracy Streaming Site

https://prison.josh.mn/lessons
216•zuhayeer•9h ago•140 comments

We built a cloud GPU notebook that boots in seconds

https://modal.com/blog/notebooks-internals
71•birdculture•4d ago•31 comments