Category: BooBoo

  • Faster 3D

    I’ve found draw_3d* to be quite slow so I added vertex buffers. You must use one to use draw_3d.

    I’ve found I can draw double the triangles of a PlayStation 2 (with more features) on this PC… PS2 can draw 16 million 75 px tris per second and I can double that with vertex buffers. That’s around 550,000 tris per frame.

  • 3D performance

    I can get 100 of these lit/individually animated models at 60 FPS.

    That’s with lighting.

    EDIT: the model has 494 triangles btw

    EDIT2: it’s double (200 models) without animation

    EDIT3: It also depends on pixel coverage, this scene with 375 models renders about 60 FPS:

  • BooBoo 3.0.11

    • Optimisations
    • Add speedtest example
  • This runs at 60 FPS

    If it weren’t for the recording it’d be 60 FPS at 5100 sprites. Using 256×256 images instead, I get 550 before 60 FPS drops. This is 1920×1080 with 1280×720 projection, so these 16×16 sprites are really drawn around 24×24 and the 256×256 sprites are drawn using 384×384 pixels.

    EDIT: this is a new example for the next version, press up/down to increase/decrease the number of sprites.

    EDIT2: I think the 16×16 sprites one is bound by the CPU running the language itself. I tried a faster GPU/slower CPU machine, and I get 1400 256×256 sprites but fewer than 5000 16×16. Here is the code:

    EDIT3: with current optimisations, I’ve got it at over 5500 sprites at 60 FPS

    const SCR_W 1280 SCR_H 720
    
    resize SCR_W SCR_H
    
    var img
    = img (image_load "bingo.png")
    
    var w h
    explode (image_size img) w h
    
    var font
    = font (font_load "font.ttf" 64 1)
    
    var imgs
    
    call spawn
    
    function spawn
    {
    	var v dx dy
    	= dx (rand 0 1)
    	= dy (rand 0 1)
    	if (== dx 0) neg_dx
    		= dx -1
    	:neg_dx
    	if (== dy 0) neg_dy
    		= dy -1
    	:neg_dy
    	vector_init v (rand (/ w 2) (- SCR_W (/ w 2))) (rand (/ h 2) (- SCR_H (/ h 2))) dx dy
    	vector_add imgs v
    }
    
    function draw
    {
    	var sz i
    	= sz (vector_size imgs)
    
    	image_start img
    
    	for i 0 (< i sz) 1 next
    		image_draw img 255 255 255 255 (- [imgs i 0] (/ w 2)) (- [imgs i 1] (/ h 2))
    	:next
    
    	image_end img
    
    	font_draw font 255 255 0 255 (string_format "%" sz) 5 5
    }
    
    function run
    {
    	var sz i
    	= sz (vector_size imgs)
    
    	for i 0 (< i sz) 1 next
    		= [imgs i 0] (+ [imgs i 0] [imgs i 2])
    		= [imgs i 1] (+ [imgs i 1] [imgs i 3])
    		if (< [imgs i 0] (/ w 2)) pos_x (< [imgs i 1] (/ h 2)) pos_y (> [imgs i 0] (- SCR_W (/ w 2))) neg_x (> [imgs i 1] (- SCR_H (/ h 2))) neg_y
    			= [imgs i 0] (/ w 2)
    			= [imgs i 2] (neg [imgs i 2])
    		:pos_x
    			= [imgs i 1] (/ h 2)
    			= [imgs i 3] (neg [imgs i 3])
    		:pos_y
    			= [imgs i 0] (- SCR_W (/ w 2))
    			= [imgs i 2] (neg [imgs i 2])
    		:neg_x
    			= [imgs i 1] (- SCR_H (/ h 2))
    			= [imgs i 3] (neg [imgs i 3])
    		:neg_y
    	:next
    }
    
    function event type a b c d
    {
    	if (== type EVENT_KEY_DOWN) key
    		if (== a KEY_UP) up (&& (== a KEY_DOWN) (> (vector_size imgs) 1)) down
    			call spawn
    		:up
    			vector_erase imgs (- (vector_size imgs) 1)
    		:down
    	:key
    }
  • BooBoo 3.0.10

    • Fix insane amount of extra drawing in custom_black_bars example (there was a 2 * scr_w + 2 * scr_h times too many images being drawn due to a typo)
    • Optimisations. I get an extra 100 FPS in CoinHunt on i5 9500T/Intel UHD 630
    • Add json_remove to remove nodes
    • Add resize_vertex_cache in case you are drawing huge amounts of geometry and want to avoid cache auto-resizing
    • Make set_viewport like set_scissor, taking buffer coordinates

    EDIT: Yes, it was drawing 840,000 images at 1280×720 instead of only the 210 needed. lol.

  • BooBoo’s new license

    It’s free for personal use. If you want to redistribute the binaries you must buy it on Humble. Please only use nooskewl.com to download BooBoo or if you have a license you can include it with your game. BTW autolaunch works if you replace data/ with your own game.

  • BooBoo 3.0.9

    • Make vertex cache increment size 32k instead of 1k. When using image_start/end or start/end_primitives, if you do a lot of drawing between them then resizing the cache was very slow. This change makes the size adjustments 32x larger so there are fewer resizes
    • Allow a fish or expression to start an expression (e.g. vector of functions or function that returns a function)
    • Add ortho, frustum, perspective to core lib. add set_projection, set_default_projection, set_viewport, unset_viewport to game lib.
    • Batch image drawing in custom_black_bars example so it’s not slow
  • I may make a real game with BooBoo

    I’m thinking of making Monster RPG Adventure, an Adventure game set in the world of Monster RPG. I bought a Fire Tablet with pressure sensitive pen for Christmas so I can draw everything. It’ll probably take many months at a minimum to finish.

    If there are any issues with BooBoo, this will be a good way to find and fix them.

  • How BooBoo works

    Everything is broken up into operators and parameters. Each builtin function separates the previous and its parameters. Expressions and fish (what I call container indexes) are slurped up from start ( to end ) as a single unit and parsed into an intermediary format. When it comes time to evaluate an expression all the appropriate handlers are called with a vector of parameters until the final embedded () is done. Expressions return a temporary value, while fish return a reference to the exact location.

    For example, the “for” loop construct in BooBoo is a pretty standard library function except that it knows about the program counter. The C++ backing function gets a list of Tokens, which can be literals, or some form of variable including expressions and fish. You can handle it the simple way and just request a number from a parameter or you may need something more advanced. Same with “if”.

  • BooBoo 3.0.8

    • Remove need for vector/map casts in known instances
    • Fix endless hits on dead bodies in DOOMED
    • Remove op/sec limit. It punishes high framerates/logic rates
    • Add more/most things to example shim5.json
    • Added json_set_*, json_save and booleans to JSON
    • Add depth/stencil/cull graphics operations
    • Render targets including the backbuffer are now created with depth buffers and stencil buffers