Converting tier 1 to tier 2

Started by Pfaber11, September 01, 2019, 13:58:54

Previous topic - Next topic

Pfaber11

Just watched a video on converting a tier 1 to tier 2 app. Really didn't seem that hard . Gonna try and do it shortly just to try it out . I'll watch the video a couple of times first to see if it'll sink in . I have looked at C++ in the past and dismissed it as too difficult and alien looking . This guy seems to make it look doable . I think if I was to manage to convert a couple of games it would be away with the mixer. Anyway here's a link to the video if anyone is interested . Also are there any tier 2 programmers on here with any advice .
sorry the link isn't working will sort it as soon as  possible. Link fixed.
https://www.youtube.com/watch?v=hMwkvCQ0910&t=1610s
Any way if you search appgamekit tier 1 to tier 2 on youtube  it's the first video
HP 15s i3 1.2 upto 3.4 ghz 128 gb ssd 16 gb ram 15.6 inch screen. Windows 11 home edition .  2Tb external hard drive dedicated to Linux Mint .
  PureBasic 6 and AppGameKit studio
ASUS Vivo book 15 16gb ram 256gb storage  cpu upto 4.1 ghz

Steve Elliott

#1
Well the code conversion was pretty much C with a namespace - not full C++.
Win11 64Gb 12th Gen Intel i9 12900K 3.2Ghz Nvidia RTX 3070Ti 8Gb
Win11 16Gb 12th Gen Intel i5 12450H 2Ghz Nvidia RTX 2050 8Gb
Win11  Pro 8Gb Celeron Intel UHD Graphics 600
Win10/Linux Mint 16Gb 4th Gen Intel i5 4570 3.2GHz, Nvidia GeForce GTX 1050 2Gb
macOS 32Gb Apple M2Max
pi5 8Gb
Spectrum Next 2Mb

Pfaber11

oh right I wouldn't really know the difference. it looked pretty painless but I would of thought it would take a while for me to convert one of my programs , probably a week or so . Not sure if they would run on android though. Took  a look at GL BASIC as well as heard it mentioned on here. 80 or so euros you can try before you buy though. I'll be sticking to AGK2 for now though no point in jumping ship right now. AGK does do everything I want right now and hopefully always will.
HP 15s i3 1.2 upto 3.4 ghz 128 gb ssd 16 gb ram 15.6 inch screen. Windows 11 home edition .  2Tb external hard drive dedicated to Linux Mint .
  PureBasic 6 and AppGameKit studio
ASUS Vivo book 15 16gb ram 256gb storage  cpu upto 4.1 ghz

Steve Elliott

#3
Yes a good thing about C++ is it's backward compatible with C, so if you don't need the extra features or complication of C++ it's much easier when coming from a BASIC background.
Win11 64Gb 12th Gen Intel i9 12900K 3.2Ghz Nvidia RTX 3070Ti 8Gb
Win11 16Gb 12th Gen Intel i5 12450H 2Ghz Nvidia RTX 2050 8Gb
Win11  Pro 8Gb Celeron Intel UHD Graphics 600
Win10/Linux Mint 16Gb 4th Gen Intel i5 4570 3.2GHz, Nvidia GeForce GTX 1050 2Gb
macOS 32Gb Apple M2Max
pi5 8Gb
Spectrum Next 2Mb

Pfaber11

I'm thinking if I manage to convert a couple of my games to C/C++ I may be in a position to use tier 2 , we'll see I suppose. That guy in the video made it look easy but I should imagine it's trickier in practice .
HP 15s i3 1.2 upto 3.4 ghz 128 gb ssd 16 gb ram 15.6 inch screen. Windows 11 home edition .  2Tb external hard drive dedicated to Linux Mint .
  PureBasic 6 and AppGameKit studio
ASUS Vivo book 15 16gb ram 256gb storage  cpu upto 4.1 ghz

Steve Elliott

#5
C++ is a very capable systems language, but I wouldn't want to write a game in it.  Of course that's just my personal opinion - give it a try and see how you get on.

Plus adding agk:: to already long agk functions, and also adding semi colons to every single line would do my head in lol.


// example

agk::SetVirtualResolution( 1024, 768);
 
Win11 64Gb 12th Gen Intel i9 12900K 3.2Ghz Nvidia RTX 3070Ti 8Gb
Win11 16Gb 12th Gen Intel i5 12450H 2Ghz Nvidia RTX 2050 8Gb
Win11  Pro 8Gb Celeron Intel UHD Graphics 600
Win10/Linux Mint 16Gb 4th Gen Intel i5 4570 3.2GHz, Nvidia GeForce GTX 1050 2Gb
macOS 32Gb Apple M2Max
pi5 8Gb
Spectrum Next 2Mb

Pfaber11

Yes I see your point . I'm just getting to grips with AGK2  tier one so why rock the boat . Still loads to learn so why complicate matters by trying to get to master tier 2 at the same time . I'm using a dual core 1.6 ghz computer so an obvious upgrade by getting a better computer would probably double my speed and if I upgraded to studio another 20% on top of that because of Vulkan. I get some alright results on what I'm programming on as well .
HP 15s i3 1.2 upto 3.4 ghz 128 gb ssd 16 gb ram 15.6 inch screen. Windows 11 home edition .  2Tb external hard drive dedicated to Linux Mint .
  PureBasic 6 and AppGameKit studio
ASUS Vivo book 15 16gb ram 256gb storage  cpu upto 4.1 ghz

Steve Elliott

#7
In that case I would try and learn AGK properly first.

As for performance, use the Sprite Atlas feature and pack your graphics into one image, rather than loading lots of single images - then use LoadSubImage.  Hiding sprites that are not required at that moment and using sync() is quicker than using the DrawSprite function.  I wonder if simply drawing off-screen (so they're clipped and not shown) might be just as fast as hiding a Sprite?  It would certainly be simpler - just change the position.
Win11 64Gb 12th Gen Intel i9 12900K 3.2Ghz Nvidia RTX 3070Ti 8Gb
Win11 16Gb 12th Gen Intel i5 12450H 2Ghz Nvidia RTX 2050 8Gb
Win11  Pro 8Gb Celeron Intel UHD Graphics 600
Win10/Linux Mint 16Gb 4th Gen Intel i5 4570 3.2GHz, Nvidia GeForce GTX 1050 2Gb
macOS 32Gb Apple M2Max
pi5 8Gb
Spectrum Next 2Mb

GaborD

Switching to tier 2 only changes game logic execution speed. It has no effect on the main engine stuff or on rendering.
For a typical smaller indie game tier1/2 makes almost no difference, the bottleneck will be the rendering anyway and the main game code would by itself run at thousands of FPS.
So unless the main goal is to learn c++ (which is a good thing if you want to work as programmer later on), you are pouring a lot of time into something that will have very little effect on your games, plus making your life harder by making your code more complex than it would be in the very simple tier1 setup. It really comes down to your goals, maybe worth it, maybe not.
Exception: heavy duty simulations or games that require tons of complex pathfinding or such, in those cases you would see a difference. (but those things should prolly be moved to the GPU)

Steve Elliott

#9
A very true statement made by Gabor, it's not the graphics that are the bottleneck in AGK Tier 1 - it's the logic (IF your game has some complicated logic).  The graphics engine in Tier 1 or 2 are identical!  The bytecode in Tier 1 is pretty efficient, and you get to use a simpler language too.

I was very surprised to see that Nuclear BASIC was actually faster than C++ plus the Nuclear Fusion Engine!  I miss that language.
Win11 64Gb 12th Gen Intel i9 12900K 3.2Ghz Nvidia RTX 3070Ti 8Gb
Win11 16Gb 12th Gen Intel i5 12450H 2Ghz Nvidia RTX 2050 8Gb
Win11  Pro 8Gb Celeron Intel UHD Graphics 600
Win10/Linux Mint 16Gb 4th Gen Intel i5 4570 3.2GHz, Nvidia GeForce GTX 1050 2Gb
macOS 32Gb Apple M2Max
pi5 8Gb
Spectrum Next 2Mb

Qube

QuoteA very true statement made by Gabor, it's not the graphics that are the bottleneck in AGK Tier 1 - it's the logic (IF your game has some complicated logic).  The graphics engine in Tier 1 or 2 are identical!  The bytecode in Tier 1 is pretty efficient, and you get to use a simpler language too.
True, that's what I've said many many times. AGK on the heavy logic side would benefit if native compiled. Sure the bytecode is fast enough for a lot of scenarios but once you hit things like realtime pathfinding for multiple objects you really need to optimise your code to occupy less loops per cycle whereas you could get away with a lot more grunt if compiled natively.

QuoteI was very surprised to see that Nuclear BASIC was actually faster than C++ plus the Nuclear Fusion Engine!  I miss that language.
Never tried Nuclear Basic - Seems I missed out on a good period of coding.
Mac Studio M1 Max ( 10 core CPU - 24 core GPU ), 32GB LPDDR5, 512GB SSD,
Beelink SER7 Mini Gaming PC, Ryzen 7 7840HS 8-Core 16-Thread 5.1GHz Processor, 32G DDR5 RAM 1T PCIe 4.0 SSD
MSI MEG 342C 34" QD-OLED Monitor

Until the next time.

Pfaber11

#11
Just wondering if I created a game in C++ would I still be able to export it to Android ? This is quite important to me . Having a sale on itch.io at the moment got 9 views yesterday but zero sales.  Early days yet though. sorry wondered off topic. And yes now you guys have explained that the advantages of tier 2 over tier 1 are not that great I will not be rushing to try it . I read somewhere that tier 2 was about 500 times quicker than tier 1 but I guess that was a load of rubbish.   
HP 15s i3 1.2 upto 3.4 ghz 128 gb ssd 16 gb ram 15.6 inch screen. Windows 11 home edition .  2Tb external hard drive dedicated to Linux Mint .
  PureBasic 6 and AppGameKit studio
ASUS Vivo book 15 16gb ram 256gb storage  cpu upto 4.1 ghz

TomToad

You can compile for all platforms in tier 2.  The only problem is that you need to install the corresponding c++ compiler for that platform.  Visual Studio for Windows and Android Studio for Android.  You also cannot just compile the same source for both platforms, the header files are different.  However, unless you are using platform specific functions, you should be able to copy the template.cpp file and compile.

If you haven't done it yet, open AGK2 and click on Tools/Install Additional Files, then fill a path under C++ libraries (make sure it's a path where you have write permission, NOT Program Files).  Click on Install.  Now navigate to that directory, [PathToAdditionalFiles]\tier2\tutorials.  There you will find tutorials on compiling for Windows and Android (and Linux, OSX, iOS if you are running from those platforms).
------------------------------------------------
8 rabbits equals 1 rabbyte.