Saturday, 26 December 2020

Twinkle Twinkle, I said Twinkle... you little....

I wanted to make my small galaxy stars twinkle........what a simple idea....NOT


Boy its hard... mainly because there's no built in random function in shaders and shaders themselves only work on the info they are given, providing a uniform of something like time, and a random value from the attribute, means you get some varation, but its mostly an everything at once blinking effect.


Anyway, to cut a long story short, I found a way to generate random numbers from some of the input data, and in turn use that to alter the base colours.. Its not too bad, but the effect only ever lasts 1 frame, and is fleeting enough to give the twinkle effect I wanted, but adding some intensity variation and colour ranges is proving harder. Sadly a video grab doesn't show the effect well at all, due to the single frame nature of it, but it does work, it is shader based and it works well, so a few more tweaks and I will get a nice shimmering twinkling starmap.


after a bit more tinkering I came up with this, a bit too many brown stars but I can tinker a bit more.


Thursday, 24 December 2020

More tests

A small update.


Still not tackling the project in anger yet, but doing a lot of tests and also bought some models from the Unity store to see how easy it would be to extract them to work on straight openGLES2/3


not too hard, but it does take a bit of time.


Also sorted out a 2D text render which will expand into a 3D text labeller... and added some new skyboxes I bought. Also a few nice freebies.



I'm pretty much satisfied witht he models I have, just need to do some LOD's on them and create a playfield to view them properly. The Game is much more overview stratgety based than individual fights so showing them up close and in detail is best done in some kind of menu info screen.



Monday, 21 December 2020

New Year, new projects

 Well its been pretty quiet on this blog for a while and maybe this is the time to change tack a bit.


I have quite a few new boards (as you may have noticed) many of which are capable of doing OpenGLES3.x or even Vulkan. So I'm making some efforts at work to upgrade the tutorials I give students to be more OpenGLES3.x or even OpenGL4.4 compliant.


To that end I need to get my own skills up to speed as I'm a bit locked into an OpenGLES2.0 mindset. So I'm going to start a new project as soon as I clear up a couple of older legacy projects.


The last couple of weeks I've been doing some tests on some new ideas on how to handle my shaders and lighting systems. By stressing out my Pi3 and Pi4 and not even attempting to stress out my Jetson. To outline some of the things that I need to revew to get better performance in a game related concept.


So, Im going to spend most of 2021 writing a game, its not a new game, though it is kinda unique, its actually a project I've been giving my students every couple of years to test their logic and basic graphic skills.


Its called Empires, its a fairly simple game, where students were tasked with creating a galaxy with 8192 stars in those stars a number of habitable planets needed to be seeded which have resources and if inhabited technolgy to trade.

Thereafter the game behaves a bit like the game of life as a planet can be colonised by the player creating a sphere of influnce around it, which if another planet comes inside that sphere can itself be converted to the players team and generate its own influence. Over time its quite possible for the player to just take over a planet and slowy wait to see all the other planets fall.

Of coruse there are other empires in the galaxy also expanding and in time coming into conflict with yours, so there are certain requirements a planet with sufficient tech needs to do to avoid invasion or to allow it to expand.

Ability to crete defensive and exploritory ships to both save and attack planets as well as large colony vessels to inhabit new ones means that you can artifically influence the growth of the empire and if careful cut off the advancement of other empires... So there's a little strategy involved.

Mostly though its an automatic process that students just have to set up and then work out ways to visualise. Its a fun challenge and over the years I've seen some amazing examples and some dire ones too.


So I'm going to do my own version of it, try to increase some of the playability a bit by introducing more strategy and interaction from the player. Students normally get 8 weeks to do this, and as I say some are amazing, I've got a year, or 2 :D depending on how much time I can get to spend on it, but I do hope to make a nice game out of it, adding some nice concepts from some of my own personal favorite RTS's.

I bought some nice model assets online and downloaded as much suitable free stuff as I could find. And started to do some basic tests on performance on targets, Ideally the Pi4, but I'll try to make something work on the Pi3, at least until I hit a full stop.

Early tests incldued some hires lighting which I can improve performance on considerably



various model tests on the models I bought, to test stress levels on a Pi4



And some point cloud galaxy generation tests. the Point cloud has a range of other uses too, it will be used for thuster trails and explosions with a few different shaders in place to keep performance up.

I need to get a few more tests done on fonts and picking algorithms, before I can make a proper start on things but thats going to be where most of January will go. I'll upate things as I go.




Friday, 4 December 2020

Slowing down a little

 I've not been buying as many boards of late. I made a decision not to rush out and buy every new one, and in a way I am glad I did. The annoyance of spending up to 100euros on a board only to discover its not actually going to do what I want due to lack of software is just too annoying.. I now wait to see what reviews and other comments on performance are like.. So far the new Orange and Bananna boards are, as usual, not getting any support. The new Odroids I did buy, but need to wait till software catches up. The N2 was very upsetting in its lack of support but its getting better.


But I did spash out on a new thing, sadly it caused me upset for different and obvious reasons


Gaahh, thats annoying, they're hard to source now as they sell out every store that stocks them as soon as they arrive, I got this from a reliable German company, but DPD did the damage in transit.. I'm sure it will get replaced soon.

Despite the case damage it does still work, and what a lovely little machine it is, a real return to 80's bedroom coding with a fully working plug in your TV and go computer. I'm in love with it... Its nippy, cool and can evern take a fair amount of overclock (if you like that kind of thing)
Can't wait to get one with with no damage. The keyboard itself isn't half as bad as I expected it to be, damn sight better than a dead flesh ZX spectrum. I really hope this does well for Rpi, as much as I love the RPi3 and RPi4, they are still precieved as mechanical control toys or server units, not as proper computers. This may finally break that mould and get kids coding again.

In other news, I'm reworking my game/demo frameworks to be more compatible with Pi4 and X11, it has required a bit of relearning and adjustments to demo's but it will all be ready in a few weeks for when this years Block C students get their chance to work on Rpi. They'll have to work hard to out do last years crop of nice content, but I always have high hopes.


Wednesday, 8 April 2020

More student vids :D

More student work...very pleased
And here's another, again a work in progress, there's some small blending issues and he still has some work to do on his planets detail . But makes the transition to an interior ok, just has to change it to a walking player and FPS view point with Physics controling his motion. Another day or 2 and he'll be there.


And another, needs a better interior though :D



Friday, 3 April 2020

its about time I showed something?

My students are doing their Block C programming assignment which is of course to make a game on RPi

Its an interesting block as it really challenges them, doing something they may never do again but that can produce some really interesting results and show them some of the challenges and skills they have to master. 
Its nice when they start to click and this is a really nice short demo from one student, who's not quite as far ahead as the others but has really taken the time to make a nice looking demo from the start


Their task is to create a solar system and fly around it to reach a space station they have to dock with , then transition to an FPS view. There's a bit of z-fighting on the spacestation to investigate but he's doing really well. Done on a Raspberry Pi3B+ with no overclocking, and only using C++/OpenGLES2.0, no engines of any kind



Wednesday, 26 February 2020

Not buying so many boards

I've slowed right down on my buying of new boards, though in truth there has not been too many to buy, at least that interest me or are sub $100

There's a couple of interesting Orange Pi 4 variants out but as they are not quite pocket money prices, and I know they almost certainly won't have drivers I am reluctant to fork out for them, but I probably will if I hear they do have drivers.

I've been spending more time getting back to coding on systems and updating various demo's to use the Pi4's X11 systems which also opens up most of the other X11 systems to use.
but I did buy or get given a few boards over the last 6 months or so and found myself working more and more on them.

The board I am most excited about is the Jetson Nano, I got work to buy one for me to experiment with as it has AI as well as graphic uses and we like to play with stuff like that at work its just over my $100 limit but since I didn't pay for it, I include it, as a benchmark if nothing else.

Wow, what a machine, just what a damn machine, incredible power....very easy to get up and running too with a very solid OS, and no messing around with expensive power supplies, though a good solid 3A micro USB is preffered. It just works...
NVIDIA Jetson Nano Developer Kit - A02

Also of note the RockPro 64 the top of the list as far as RK3399 boards are concerned, Pine were very kind to send me a demo model, its not a small board, but it packs a lot of performance, I will need to try their Rock 64 board soon, which has a smaller Rockchip but should still be on a par with a tinkerboard.



Also donated was another RK3399 board, from Radxa, the RockPi4, hmmm a nice board but missing some performance somewhere as it lags behind other RK3399 boards, but still, after some updates has become a very solid and reliable board
Image


Also of note is the Odroid N2, but its software isn't there yet, its coming though and I'm sure once the XU4 developers start to get a taste for the power this thing has  it will really start to fly, but it is 2x the cost of an XU4, and it still keeps delivering on its most power for the buck promises. I keep updating the N2 hoping to see significant improvements but nothing so far.. CPU is a beast, GPU is really not being fully used and it lags behind even the RockPi4 in terms of GPU performance.
Odroid N2 - 4GB RAM with Black Case [77301]
Also in the pot, a strange little Libre system, again on kickstarter, the la frite..an Amlogic 805 system like the Odroid but no where near as reliable
Image result for libre computer la frite
I got the little metal case for it to help its cooling.... its a bit fickle though not really been able to get it to stay stable and boot twice in a row...the website has the worst guides I'ver ever seen, unless you're a guru...don't bother trying this.

Hmmm what else,nope I think thats pretty much it. There's a lot of nice Rockchip systems coming on line the RK3399 chip is especially popular and nearly always has some GPU support on their supplied OS's, I was kinda hoping that the Rpi4 would be based on it, but can't say I'm unhappy with what they produced, I like the connection to Broadcom and even though they'll never be fast they tend to be reliable.

As always some updates and performance issues are listed on my forums at Scratchpadgames.net