Less Optimising, More Coding. (Though Optimising is coding.. You know what I mean!)
-=-=-
OK, I need to stop optimising JSE. Mostly because it's not working, but also because I'm supposed to be releasing a game, today, and it's nowhere near ready. It's barely started, if I'm honest.
So far, it looks like this.
There's not an awful lot to do, here. Flap around, something something, nothing much.
I need to add enemies.
I need to add a reason to roam.
I need to add an exit.
And I need to add pretty much the entire game, really.
So, that's what I'm going to focus on today.
I definitely won't be working on Optimising again, today.
Nope.
..
.. maybe
Optimised!!
v.3gip of JSE is now online, and should be a teensy tiny bit faster.
I've done a TON of rewriting of the underlying functionality over the past few days, and it's somewhat disheartening to find that, after as much work as I've done, it's barely made a dent.
Yesterday I realised a fun little reason for a ton of slowdown, which is .. if you go ever so slightly over the 16.6667 milliseconds of a frame, it then will always take 33.33334 milliseconds for that frame.
This is kinda something that I knew, but that I never really thought about until yesterday.
Essentially if you're doing all the work to make some gameplay happen, and then afterwards draw the score on the top, say, if that drawing of the score eaks the engine by a fraction of a millisecond over the frame-time, then ... you're going to get 30fps, not 60fps, no matter how hard you try.
The trick is, then, to try to optimise the little things. The elements that, though they seem minor, are the key to reducing that teensy tiny fraction of a millisecond, to ensure that that doesn't happen.
I'm also still having that huge disparity between when it's being slow and when it's being fast. On my laptop, I'm seeing Optimisationalism 5 leap between 97 milliseconds on first run, to 55 on second. (and then consistently 55 thereafter)
It's really baffling as to why that's such a huge difference. Obviously it's something Safari'ish, as Arc, Firefox, Opera and even Edge (nnngh) on the Mac will ALL run the code at full speed, first time, all of them averaging the same 68 milliseconds, no matter how many runs I give them.
.
Now, I'm no conspiracy nut, but having a game run at about half the speed the first time you run it.. that .. that kinda feels like a good way to stop people wanting to play games in their browser.. Am I right?!
Hmm..
Anyway, I'm running out of ways to optimise again, so I think I'll likely leave it here for the meantime, and get back to doing what I'm supposed to be doing, which is making epic games that nobody plays!
Hurray!
The clown is happily flapping around in the air like a bird with its arms stretching out.
He flaps them around and for some sort of reason he manages flight like a bird or a plane.
Up, Up, Up he will fly when he's flapping his arms so wildly.
Up, Up, Up he will glide through the air like he's wearing a parachute.
And then down to the ground he will finally go as he loses momentum, his arms giving up,
He will dive to the ground with a wonderful thud.
(thud)
And then all of the beautiful sprinkles and sparkles of confetti blood will all fly all around,
As a circus performer throws buckets of colourful paper around to disguise all the blood that the clown has dispersed through the tent.
Up, Up, Up he will fly when he's flapping his arms so wildly.
Up, Up, Up he will glide through the air like he's wearing a parachute.
And then down to the ground he will finally go as he loses momentum, his arms giving up,
He will dive to the ground with a wonderful thud.
[Dave is frantically checking various systems while Greenie meticulously arranges games on shelves. Mrs. Thompson and her friend Barbara are organising the ScrunchCake display cases.]
Dave: Three days! Only three days!
Green: The games are sorted. I've put three copies of Count Duckula 2 out. Hopefully nobody complains.
Dave: That's... actually quite helpful.
Barbara: (examining a ScrunchCake) So these actually sell?
Mrs. Thompson: Like hot cakes! Well, hot sausage cakes.
[Brian emerges from the kitchen with a young woman following him]
Brian: This is Sarah. She's worked in three different bakeries!
Dave: But has she worked with sausages?
Sarah: (confused) I worked in Greggs.
Dave: Awesome headhunting, Brian!
[Dave suddenly freezes]
Dave: Oh no.
Green: What now?
Dave: We haven't got a float for the till!
Mrs. Thompson: I thought you'd sorted that?
Dave: I was distracted by the ScrunchCake Sentinel calibration!
Green: (muttering) Of course you were.
[Barbara is examining the ceiling-mounted Sentinel]
Barbara: Is this thing safe?
Green: As long as we intentionally switch it off, each morning.
Dave: It's perfectly safe! We just need to duck occasionally.
Mrs. Thompson: David, perhaps we should focus on the till situation?
Dave: Right! We need... what do we need?
Green: Change. Lots of change. And probably some actual money-handling procedures.
Dave: I thought we'd just wing it. That usually works.
Sarah: (to Brian) Is he always like this?
Brian: So far, yep.
[Dave starts pacing]
Dave: OK, we need float money, we need procedures, we need...
Green: A staff rota?
Dave: Have you not done that?
Green: Me? Why would I do that?
Mrs. Thompson: I thought Barbara and I were doing Tuesdays and Thursdays?
Dave: There we go. We've got a system in place. That's helpful!
Barbara: First I've heard of it.
Mrs. Thompson: Oh, did I not mention it?
Green: Who's doing the ScrunchCake sales for the rest of the week?
Mrs. Thompson: I think that's you, Dear.
[A ScrunchCake launches across the room]
Sarah: (ducking) OK, that's NOT safe!
Dave: It's in the contract!
Brian: There's contracts?
Green: We haven't got contracts, Dave.
Dave: (panicking) We need contracts!
Mrs. Thompson: Calm down, David. We'll sort it all out.
Dave: Three days!
Green: At least the games are alphabetical.
[End credits roll as everyone ducks another flying ScrunchCake]
Views 20, Upvotes 0
Daily Blog
,
Jse
,
Optimising
Places
Archives
Site credits : Jayenkai
(c) Jayenkai 2023 and onwards, RSS feed
52