Welcome, Guest
You have to register before you can post on our site.

Username
  

Password
  





Search Forums

(Advanced Search)

Forum Statistics
» Members: 5
» Latest member: Arzana
» Forum threads: 15
» Forum posts: 18

Full Statistics

Online Users
There are currently 5 online users.
» 0 Member(s) | 5 Guest(s)

Latest Threads
hello
Forum: Scratchpad Games
Last Post: Brian Beuken
02-20-2018, 11:36 AM
» Replies: 1
» Views: 108
Optimizations
Forum: Scratchpad Games
Last Post: Brian Beuken
02-20-2018, 10:59 AM
» Replies: 0
» Views: 6
First time here, hello fr...
Forum: General Chat
Last Post: Brian Beuken
02-18-2018, 11:35 AM
» Replies: 1
» Views: 15
FriendlyArm Nano Pi M1
Forum: Other SBC's
Last Post: Brian Beuken
02-04-2018, 05:00 PM
» Replies: 1
» Views: 47
Khadas Vim2
Forum: Other SBC's
Last Post: Brian Beuken
02-04-2018, 01:06 AM
» Replies: 0
» Views: 31
Things to note
Forum: Raspberry Pi questions
Last Post: Brian Beuken
02-03-2018, 08:00 PM
» Replies: 0
» Views: 57
So....what do I do?
Forum: Getting started
Last Post: Brian Beuken
02-03-2018, 04:58 PM
» Replies: 0
» Views: 37
What is VisualGDB?
Forum: General Chat
Last Post: Brian Beuken
02-03-2018, 04:41 PM
» Replies: 0
» Views: 32
C++ Coding Magpi#66
Forum: General Chat
Last Post: Brian Beuken
01-26-2018, 04:37 PM
» Replies: 0
» Views: 63
I ran out of space?? Resi...
Forum: Other SBC's
Last Post: Brian Beuken
01-25-2018, 09:28 PM
» Replies: 0
» Views: 69

 
  Optimizations
Posted by: Brian Beuken - 02-20-2018, 10:59 AM - Forum: Scratchpad Games - No Replies

Readers of the book will have noted that many times I pointed out that there were better ways to do many of the concepts raised.

In fact the way most of the code was written it is very obvious that there are better ways, but I took a decision not to go into much detail on that, simply to allow new users the chance to get totally comfortable with getting their code to work. Forcing people to optimize code before they have fully understood what they are doing is a recipe for disaster, so for me it made sense not to get into that in the book, just show the basic code, get it working and once its working, then is the time to explore how to make it work better. 

It would be nice to have a discussion here on how we can improve the performance of our projects (by quite some amount) if we were to use a more effective render system, and implement some multi core work. I'd love to hear your thoughts on how you can improve things, and show some results to inspire others to really get that code moving.

Print this item

  First time here, hello from Thijs.
Posted by: McKon - 02-17-2018, 08:33 PM - Forum: General Chat - Replies (1)

Hello everyone, 

It seems like I'm one of the first members here. I'm known as Thijs van Boesschoten, I've studied networking and am doing a study on programming at the moment. In my networking classes we were thought how to use the pi as a networking tool/system. As such at the time I bought a Raspberry 0 and Arduino uno and I'd like to see what they will be able to do game wise(hopefully without melting). 

As such I'm seeing myself as a near complete rookie and would love to learn more about using SBC's and game programming.

Print this item

  FriendlyArm Nano Pi M1
Posted by: Brian Beuken - 02-04-2018, 04:16 PM - Forum: Other SBC's - Replies (1)

One of my favourite of the clones, mainly becuase it comes with all drivers and fully working pretty much out of the box, it does not take a lot to get this very cheap quad core up and running.

Of course being cheap it does not have much in the way of performance, its ancient Mali400MP2 mean it has much less power than the Raspberry, and it only has an H3 running at 1.2ghz  its also a little prone to overheating but not too much.

Its a game little beast, comes with Debian and Ubuntu, I tend to use Debian, and GLMark2-es reports a modest speed of 72, so it is accelerated, its just not fast.

Setting up is pretty much the standard case of installing all the additional libs, locating where the standard libs are, they are not the same as Raspberry, check the generic build demo to see what it does.

And then simply compile and run as usual, it runs about 80% the speed of a Raspberry which is a good excuse to practice some GPU optimization concepts we never covered in the book.

Sadly FriendlyArm seem to have discontinued this very cheap fun board and replaced it with a more expensive M1Plus version with more RAM, eMMC store, Wifi and BT, but at 3 times the price....not sure I can justify the extra cost for the same cpu and gpu.

Print this item

  Khadas Vim2
Posted by: Brian Beuken - 02-04-2018, 01:06 AM - Forum: Other SBC's - No Replies

Not sure actually if I bought the basic or the pro, its reporting 2G of RAM for a basic, but has 32GB eMMC ram for a Pro, on board...
hmmm either way, here's a small report on using it. This is reposted from my Tiny Monsters that play games blog


This is an odd beast for sure, I had trouble with it simply because it uses a USB C cable for power, and even though it came with one my usb output from the monitor never seemed to give enough power and it would frequently die at the end of a boot.
Well finally I got a converter for micro to USB C, and also managed to finally work out how to update the on board memory to have a linux (ubuntu) system instead of the default, but actually rather nice Android

This is an 8 core beast (big/small) which should put it on a par with the mighty Odroid XU4, it even has a better GPU, a Mali T820, but only MP3 , not quite up to the XU4's MP6 but even so its a next gen chip so it might manage it. It's an ES3.2 chip, which even if it can't quite provide the parallel grunt sending ES2.0 shaders to work, its ES3.2 shaders should make them cry.
After a bit of head scratching which turned out to be nothing more than very bad documents that didn't immediately make sense I was able to get it to reflash, and then update.

Time for the graphics fun to begin but of course there's no drivers on board...oh well...

Installed GLMark2-ES2 ok, after I'd allowed the onboard installer to do an update and reset. It does not identify the MaliT820 though so its basically emulating and slowly as you might expect, frame rates so far are nothing to write home about and of course it errors a lot at the death, eventually exiting with no score.

I'll see if I can get the usual mesa libs on board and try to get a test build sorted...should only take an hour

And bugger me, that was actually quite easy, once I'd set up the standard libs etc, and also installed and activated SSH server with

sudo apt-get install openssh-server
sudo service ssh start

So that Visual GDB could make the connections, I had no problems getting the generic multi config Mazehunt to build at run at all aside, from the known keyboard problems, the chmod fix however got me control and off it went.

Its running very slow of course due to lack of hardware access to the GPU but its performing as well as any of the other units without graphics. So I'm genuinely impressed. That was the easiest I've had so far, and the 1st time I've been able to do a -j8 options without the target dying. Most impressive. It does get bloody hot though, and the fact its already encased in a perspect case means I can't add a heat sink or fan to it..but it does not seem to be too worried and is running all 8 course at a nice old rate.

Will it ever get GPU access? I dunno...we'll see. Apparently Android has drivers, so maybe I'll use this as the Android port example.

Its a fast beast too, sysbench has it doing 10000 primes in 1.6212s, thats lighting fast..Odroid XU4 takes over 16 seconds thats a factor of 10 times and yet the Odroid is clocked a little higher.
If the GPU driver is ever released this will be a serious beast to use for dev...and OpenGLES3.2 on board will make it unstoppable...for now though its just a very fast CPU system.

Print this item

  Things to note
Posted by: Brian Beuken - 02-03-2018, 08:00 PM - Forum: Raspberry Pi questions - No Replies

The Raspberry is my favorite goto system for developing a project, its not the fastest, it does not have the best GPU but it is basically totally solid and totally reliable and of course the Raspberrypi.org forums are full of useful and helpful advice that pretty much solves all problems

In game programming terms the only issue I have with it is the keyboard system and the relative lack of GPU power.

Keyboards, I am still working on, usually they are ok, but recent updates mean that my wifi keyboard/mousepad combo isn't being registered as a keyboard any more but if I register it as a mouse it does work??

That's not ideal though I want to be able to have anyone run the games I make so need something more reliable, this is ongoing.

GPU power is the other thing and that is actually great fun to play with because it all boils down to how well you optimize your rendering systems, that creates lots of chances to play and experiment.  I did some work on optimizing in the book, but decided to take it out of the final draft as it was increasing the difficulty curve quite a bit, also its best demonstrated with video and more advanced/complex models and environment than I had available in the book.
So I will discuss optimizing in the main site in the coming months when I add some online tutorials, it will be applicable to most SBC's but for sure the current demo's can all be made quite considerably more efficient.



I can't see there will be a lot of specific questions here that are not covered in the RaspberryPi.org forums but feel free to ask, and I'm sure there will be someone who can answer.

Print this item

  So....what do I do?
Posted by: Brian Beuken - 02-03-2018, 04:58 PM - Forum: Getting started - No Replies

VisualGDB is for me the best option for coding on SBC targets. But it does come at a cost and not everyone can afford it.

The next best option is to use Visual Studio's cross platform development options for Linux.

This provides almost all the functionality that VisualGDB does, Edit and debug on the PC, console screen display, but only build on target so it can be a slow build.
It can be a bit clunky to set up, but there is a default raspberry project that can be used to get started, and most default linux projects will work on other machines. Do not use the Raspberry config, if you are not using a raspberry, not all ARM systems are the same, it don't work like that Big Grin

It needs a tiny bit more understanding of the build process to get set up, so its best to use the 30days free VisualGDB trial to get familiar with what is happening during a build process, and this will be more understandable.

Its also a bit of nightmare if you have more than one device listed for it, but assuming most people are normal and not like me with 20 different system to target, if you have 1 system its ok, it just makes you jump through strange hoops to add others.

A few of the book and Magpi projects will be converted to this system to demonstrate how to get going.

Print this item

  What is VisualGDB?
Posted by: Brian Beuken - 02-03-2018, 04:41 PM - Forum: General Chat - No Replies

In the simplest terms VisualGDB is a magical system that saves weeks of work, litres of sweat and probably several pints of blood loss from bleeding knuckles bashing on keyboards.

Available here https://visualgdb.com/

VisualGDB is a plug in for your PC based Visual Studio IDE. It handles all the connections to your target system SBC, It lets you build your code on the target (reliable but slow) or on the PC, (basically just as reliable, but 100 times faster). It keeps track of all the libraries and assets you need and makes adding new things just as easy, allows you to debug on the PC while the SBC is running its code and is just generally amazing and useful.

Its not free though, but it is pretty cheap, especially if you plan to do a lot of coding, and  indeed value those litres of sweat and weeks of work which can now be productive rather than having lots head scratching panicked wtf moments.

Of course its also not prefect, it does have a few quirks, it can be complex if you try to use the advanced features, and it does update every year or so requiring a bit more of a relearn.

But if you are in any way serious about working in a professional manner and producing high quality work, this is the package you need to have.

Try it out for 30 days free (if you are using the Fundamentals book, don't start the trial till it tells you)  and see for yourself just how much time and effort it will save you.

Print this item

  C++ Coding Magpi#66
Posted by: Brian Beuken - 01-26-2018, 04:37 PM - Forum: General Chat - No Replies

This one is a bit of a step up, putting graphics system in place, but even so we're only half way there. The nature of a 4 page article makes it very hard to keep the content relevant and interesting. But stick with it, we'll expand on it more each week and soon have a bunch of recognizable game characters chasing you around.

Print this item

  I ran out of space?? Resizing the SD/root partition
Posted by: Brian Beuken - 01-25-2018, 09:28 PM - Forum: Other SBC's - No Replies

The Raspberry is a good little unit, and one of the tasks it does for you automatically now is to resize the root partition so that you get the full size of your SD card. Sadly most other SBC's don't, and expect you to know how to do that.. But its actually not that obvious, especially if like me you are not a regular linix user.
When you create a new image on your SD it does not start off with all the SD memory free, so you have to resize, if you find your SBC is resizing (a few do) then you won't need this, but I never could get a simple answer to the issue!


Lucky I stumbled onto this blog post that helps to explain it all, you have to do this the 1st time you boot up a new SD image, if you write anything before you do that you will lose data.
Here's the original post
http://gleenders.blogspot.nl/2014/08/ban...-root.html 

As its quite old, and the blogger does not seem to post any more, it might vanish so here is the bones of it again

sudo fdisk /dev/mmcblk0
In fdisk:

Press ‘p’ to print the partition table:

Disk /dev/mmcblk0: 15.9 GB, 15931539456 bytes
4 heads, 16 sectors/track, 486192 cylinders, total 31116288 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x00084078

   Device Boot           Start         End      Blocks   Id  System
/dev/mmcblk0p1            2048      124927       61440   83  Linux
/dev/mmcblk0p2          124928    31116287    15495680   83  Linux 

the 124928 number may well be quite different on your SD, but take note of it, its this number that matters as its the start of the partition
Press 'd' to delete a partition:
Enter '2' to choose the second partition.
Press 'n' to create a new partition:
Enter 'p' to select primary as partition type.
Partition number: enter to accept 2 as default partition number.
First sector: enter to accept default.
This should be that 124928 number of the number you took not of as the start
Last sector: enter to accept default.
Press 'w' to write the new partition table.
Reboot to force the kernel to recognise the new partition table.

sudo reboot
After the system has come back up you still have to resize the partition.

sudo resize2fs /dev/mmcblk0p2


when done you will now have the full size of your drive available to you to store data

Print this item

  How?
Posted by: Brian Beuken - 01-24-2018, 11:45 AM - Forum: Getting started - No Replies

If you don't have access to a PC to use as a dev system, its still perfectly possible to work directly on your Raspberry/SBC using Code::Blocks which is an IDE designed to run on your target. 

It does mean that you don't always have access to your debugger (in a full screen game) and the build and run time is much slower than a PC build, but it is of course cheap and easy to do.

There are MANY other IDE's available for free on SBC's though, you can even just use a text editor if you want but its hard work and I don't like hard work, so I will only comment on Code::Blocks, until I find a better one Big Grin

Be aware though that working on your target as your editor, risks the loss of your source files, not a common thing, but certainly something to be aware of, so make sure you keep backups (ideally on line) and use as big media store as you can manage, as your assets and files will fill up a small SD quite quickly.

As with the VisualStudo 2017 Linux builds, I will convert a few projects to run on Code::Blocks so you can get them to work and experiment yourself.

Print this item