Monkey2 Bunnymark (github)

About Monkey 2 Forums Monkey 2 Projects Monkey2 Bunnymark (github)

This topic contains 31 replies, has 12 voices, and was last updated by  Abe _King_ 1 year, 3 months ago.

Viewing 15 posts - 1 through 15 (of 32 total)
  • Author
    Posts
  • #11454

    Abe _King_
    Participant

    Hello! My name’s Abe and I’ve been looking into Monkey2 recently and decided to take a dive and create a quick and simple Bunnymark. Being that I’m new I’m sure there’s plenty of you M2 veterans out there that can improve my code and, that being said, I would very much appreciate that feedback and help!

    As of right now, I am getting decent framerates. Decent as in comparison to a couple of other engines I’ve used in the past. Engines ( GM2, Godot, Luxe, HaxeFlixel, HaxePunk, Defold ). The Monkey2 workflow feels just about right to me, I’m still trying to decide if it’s engine I’ll settle with but only time will tell!

    Here’s the repository: https://github.com/forgotten-king/Monkey2-BunnyMark
    Here’s a short clip: https://streamable.com/cy777  (Gets very blurry towards the lower frame rate )

    Music by one of my favorite artists, ULI. Track here: https://soundcloud.com/uli_music/1032a
    Bunny Assets borrowed from: https://github.com/dmitryhryppa/Frameworks_test

    #11457

    Jesse
    Participant

    Hi Abe, Welcome to the forum.

    interesting results!
    Have you tried running it in release mode?

    I get 10,000 at a steady 62 frames a second in release mode.
    and 3,000 at a steady 62 frames a second in debug mode.
    2013 MacBook Air 1.7Ghz.

    Personally, I think thats pretty good.

    A question: Why are you determining what language/Engine to use based on the speed of the graphics output?

    #11458

    Abe _King_
    Participant

    Hi Jesse, thanks for taking the time to try it out :). I would be very happy if you could push your binaries for MAC if possible!
    I am nearly certain I was running in release mode, at least I could have sworn :). I’ll check once more to be sure.. Yeah, I have release mode checked and for some reason getting a max of 3.4k! I’ve sent the binary to a friend who has a better setup than me on windows and got around 4.7+ before seeing 48 fps.

    Your numbers are very good, I would be more than happy to call the engine my own if I could push that much out.

    To answer your question, it’s not necessarily the best reason to choose an engine for the graphics output alone, but I do feel substantially more comfortable with an engine that can push out a minimum of 6k on my machine. It just gives me a better feel for what room I’m given to work with. Rooky reasons!

    #11459

    Jesse
    Participant

    here is the link to the binary:
    https://www.dropbox.com/s/24ws94xn2r46dqe/Bunnymark.zip?dl=0

    I did cheat. I wasn’t going to press the mouse button until I reached the 10.000 bunnies so I changed the arrays size to 10,000 to start with. LOL.

    [Edit]

    What version of Monkey2 are you using?

    #11460

    therevills
    Participant

    On my rig* I can run 10k without it dropping frames.

    I also changed the controls to:

    [/crayon]

    * 7700K, Geforce 1080, 16GB

    #11461

    Abe _King_
    Participant

    Thanks for the feedback, friends! I’ve added in your snipper @therevills. That’s a useful addition!

    @jesse, I attempted to see if maybe it was my array resizing that was causing the problems and changed the initial size to higher numbers but I got similar if not the same results prior to that. And thanks for the binary! I’ll probably post that tomorrow

    Still can’t seem to get better performance although I am convinced I should have it..

    [ Edit ]
    Jesse, I’m using the latest itch.io release – believe it was from 2-3 days ago.

    #11465

    abakobo
    Participant

    I’m getting 3k on a 3630QM laptop with GT635M.
    Strange thing is desktop or release only slightly affects speed!

    Do you know there’s a FPS count for you? No need to use millisecs and all the stuffs (and your avg was sticked at 62 because you where using only integers in your division so it was not able to show the real 60) You should always put a float in a division if you want accurate results.

    Local avg := 1000/( ( elapsed /frames*1.0) )

    canvas.DrawText(” FPS: ” + App.FPS, 300, 0 )

    #11466

    Abe _King_
    Participant

    @abakobo Thanks for the input and help/feedback. The App.FPS tip is very helpful  :). Regarding the frames needing to be casted to a float – I wasn’t even aware of that! I also figured out by chances that you can cast a variable using something like Float(frames) in this very project (as can be seen used in my clamp on the bunnies X-axis).

    I will go ahead and replace my makeshift FPS Avg with the app!

    Just a quick reminder for the future: Don’t be shy to send any pull requests to the repository! I’m always happy to see/add to who my contributors are :).

    #11468

    degac
    Participant

    This the results on my scrap-puter (AMD Phenom II x4 955 3.2 Ghz, 4GB, Windows 10 – AMD RADEON HD 5700 (Catalyst 2015… I’m upgrading in this moment to see if it there’s an impact of the performances!)
    Changed to FULLSCREEN (in windows.Fullscreen initialization)
    Initial array: 3000 bunnies
    FPS 58/62 (floating very quick!)
    From 3.000 to 3.400 – FPS quite stable (58..62)
    At 3500 there’s a ‘drop’ to 54… and starts everything to be unstable, it’s possible to see hiccups

    #11469

    AdamStrange
    Participant

    on mac (high sierra)
    3100 stable at 62fps
    3200 drop to 58 fps
    3500 55fps
    4000 49fps

    all windowed.
    fullscreen not resized the window correctly, but the same fps

    #11472

    Abe _King_
    Participant

    Hello everyone! Thanks for your results :). Glad to see you all trying it out and having some benchmarking fun. I’ve updated some of the code with big thanks to therevills and abakobo!

    Now you should be seeing smoother FPS calculations and have a bit more control over your bunnies.

    [ Edit ]
    We do seem to be getting a fairly good variety of test samples and the results are indeed interesting. Maybe, in the end, I can put together some graphs for the results!

    #11473

    peterigz
    Participant

    Hmm, this seems very slow to me. I tried it and it only got to 4-5k before the frame rate started to drop which doesn’t seem right. After a bit of experimenting if I changed it to only draw one type of bunny I got up to 200k at 60fps. Surely something must be amiss here under the hood? Or is it to do with drawing different textures? Maybe try with the bunnies packed into a single sprite sheet. Maybe mojo can be optimised here somehow?

    #11475

    Mark Sibly
    Keymaster

    Or is it to do with drawing different textures?

    More than likely – changing some rendering ‘state’ (blendmode, shader, material etc – NOT color or matrix) will cause an internal ‘flush’ which will slow things down. Worse case would be something like…

    …where image1 and image2 used entirely different textures.

    This would not be able to queue ANY draw ops, ie: each: DrawImage would effectively be doing a Flush.

    Sorting drawing ops ‘by texture’ (ie: ‘by image’ ) will minimize these problems. Ditto, sorting by blendmode, ie: draw all opaque objects, then all transparent objects.

    Using a texture atlas will also help a great deal, as an atlas allows you to draw different images from the same texture.

    Perhaps the above test could be modified to include a togglable ‘sort by texture’ mode to show the difference?

    #11476

    Abe _King_
    Participant

    I figured that was the case, but I have experience with a different renderer where it can push out about 90,000 images per second at 60fps for one texture. I was very impressed when this engine could push out 3.4k with 4 different textures and the other renderer could only pump 1000.

    So, now, re-testing this whole thing once more, I’ve managed to see a goof up somehow. Turns out using a single texture actually DOES MARGINALLY improve performance. Now I’m very convinced that this engine is more than capable to pump out a very strong game.

    Just need to figure out what the support is in Monkey2 for texture-atlases as that can simplify the task quite a bit for non-trivial things as opposed to the trivial sub-imaging for the bunnies. @Mark Sibly, any examples I can look at for such a thing?

    I’ll definitely create a dual-test for testing texture grouping and separate. Thanks for the notice guys.

    #11477

    peterigz
    Participant

    That’s really interesting,  something worth bearing in mind when optimising. Here’s a modified version where each bunny image is put into it’s own separate stack and drawn one after the other. I get over 230k before the fps goes lower than 60. Does have the disadvantage in that one type of bunny (red in this case) gets drawn over the top of the others but that’s where you’d switch to an atlas if that was an issue I guess.

Viewing 15 posts - 1 through 15 (of 32 total)

You must be logged in to reply to this topic.