September 23, 2019, 03:06:17 PM

Author Topic: Converting tier 1 to tier 2  (Read 260 times)

Offline Pfaber11

  • Sr. Member
  • ****
  • Posts: 280
    • FABERS GAMES
Converting tier 1 to tier 2
« on: September 01, 2019, 01:58:54 PM »
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

Offline Steve Elliott

  • Hero Member
  • *****
  • Posts: 2000
Re: Converting tier 1 to tier 2
« Reply #1 on: September 01, 2019, 04:15:17 PM »
Well the code conversion was pretty much C with a namespace - not full C++.
Windows 10, 64-bit, 16Gb RAM, CPU Intel i5, 3.2 GHz, Nvidia GeForce GTX 1050 (2Gb).
MacOS Mojave, 64-bit, 8Gb RAM, CPU Intel i5, 2.3 Ghz, Intel Iris Plus Graphics 640 1536 MB.
Linux Mint 19.1, 64-bit, 16Gb RAM, CPU Intel i5, 3.2 GHz, Nvidia GeForce GTX 1050 (2Gb).
Raspbian Buster, pi4 4Gb RAM,1.5Ghz

Offline Pfaber11

  • Sr. Member
  • ****
  • Posts: 280
    • FABERS GAMES
Re: Converting tier 1 to tier 2
« Reply #2 on: September 01, 2019, 05:26:47 PM »
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.

Offline Steve Elliott

  • Hero Member
  • *****
  • Posts: 2000
Re: Converting tier 1 to tier 2
« Reply #3 on: September 01, 2019, 06:08:14 PM »
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.
Windows 10, 64-bit, 16Gb RAM, CPU Intel i5, 3.2 GHz, Nvidia GeForce GTX 1050 (2Gb).
MacOS Mojave, 64-bit, 8Gb RAM, CPU Intel i5, 2.3 Ghz, Intel Iris Plus Graphics 640 1536 MB.
Linux Mint 19.1, 64-bit, 16Gb RAM, CPU Intel i5, 3.2 GHz, Nvidia GeForce GTX 1050 (2Gb).
Raspbian Buster, pi4 4Gb RAM,1.5Ghz

Offline Pfaber11

  • Sr. Member
  • ****
  • Posts: 280
    • FABERS GAMES
Re: Converting tier 1 to tier 2
« Reply #4 on: September 01, 2019, 07:49:42 PM »
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 .

Offline Steve Elliott

  • Hero Member
  • *****
  • Posts: 2000
Re: Converting tier 1 to tier 2
« Reply #5 on: September 02, 2019, 10:04:51 AM »
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.

Code: [Select]
// example

agk::SetVirtualResolution( 1024, 768);
 
Windows 10, 64-bit, 16Gb RAM, CPU Intel i5, 3.2 GHz, Nvidia GeForce GTX 1050 (2Gb).
MacOS Mojave, 64-bit, 8Gb RAM, CPU Intel i5, 2.3 Ghz, Intel Iris Plus Graphics 640 1536 MB.
Linux Mint 19.1, 64-bit, 16Gb RAM, CPU Intel i5, 3.2 GHz, Nvidia GeForce GTX 1050 (2Gb).
Raspbian Buster, pi4 4Gb RAM,1.5Ghz

Offline Pfaber11

  • Sr. Member
  • ****
  • Posts: 280
    • FABERS GAMES
Re: Converting tier 1 to tier 2
« Reply #6 on: September 02, 2019, 12:15:52 PM »
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 .

Offline Steve Elliott

  • Hero Member
  • *****
  • Posts: 2000
Re: Converting tier 1 to tier 2
« Reply #7 on: September 02, 2019, 12:45:38 PM »
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.
Windows 10, 64-bit, 16Gb RAM, CPU Intel i5, 3.2 GHz, Nvidia GeForce GTX 1050 (2Gb).
MacOS Mojave, 64-bit, 8Gb RAM, CPU Intel i5, 2.3 Ghz, Intel Iris Plus Graphics 640 1536 MB.
Linux Mint 19.1, 64-bit, 16Gb RAM, CPU Intel i5, 3.2 GHz, Nvidia GeForce GTX 1050 (2Gb).
Raspbian Buster, pi4 4Gb RAM,1.5Ghz

Offline GaborD

  • Sr. Member
  • ****
  • Posts: 296
Re: Converting tier 1 to tier 2
« Reply #8 on: September 02, 2019, 08:47:33 PM »
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)

Offline Steve Elliott

  • Hero Member
  • *****
  • Posts: 2000
Re: Converting tier 1 to tier 2
« Reply #9 on: September 02, 2019, 08:56:02 PM »
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.
Windows 10, 64-bit, 16Gb RAM, CPU Intel i5, 3.2 GHz, Nvidia GeForce GTX 1050 (2Gb).
MacOS Mojave, 64-bit, 8Gb RAM, CPU Intel i5, 2.3 Ghz, Intel Iris Plus Graphics 640 1536 MB.
Linux Mint 19.1, 64-bit, 16Gb RAM, CPU Intel i5, 3.2 GHz, Nvidia GeForce GTX 1050 (2Gb).
Raspbian Buster, pi4 4Gb RAM,1.5Ghz

Offline Qube

  • Administrator
  • Hero Member
  • *****
  • Posts: 2115
Re: Converting tier 1 to tier 2
« Reply #10 on: September 03, 2019, 04:48:45 AM »
Quote
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.
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.

Quote
I 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.
Until the next time...

Offline Pfaber11

  • Sr. Member
  • ****
  • Posts: 280
    • FABERS GAMES
Re: Converting tier 1 to tier 2
« Reply #11 on: September 03, 2019, 10:21:05 AM »
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.   

Offline TomToad

  • Sr. Member
  • ****
  • Posts: 429
Re: Converting tier 1 to tier 2
« Reply #12 on: September 03, 2019, 11:17:32 AM »
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.