|
Post by eyfenna on Oct 7, 2016 6:26:06 GMT -6
I posted an example of a code that displays hexagons. Since then I found some good information on hexagons and how to to calculate stuff on a field on amitp Hexagonal Grid math explained.I rewrote the code and then thought about doing a little strategy game with spacehships moving on hexagons. So here's the starship venture still in dock with rudimentary " navigational planning system " working mostly, just left click on the star ship and move the mouse courser over a hex field and see a yellow path of hex fields appear. Engines are still in construction. Attachments:spaceship.zip (12.77 KB)
|
|
|
Post by n00b on Oct 7, 2016 13:15:42 GMT -6
I just tried your demo. Your path finding algorithm runs flawlessly. I have a suggestion on how to improve rendering speed. It has to do with how rcbasic handles graphics. Internally rcbasic uses hardware accelerated rendering which will use directx on windows and opengl on any other system. This means all graphics drawn to the window are being rendered by the gpu rather than being blitted by the cpu. This has a advantages and disadvantages when compared with sdlbasic. The biggest advantage is that it can draw a lot of images a lot faster than what sdlbasic can. The disadvantage is that drawing primitives like pixels, lines, circles, etc. are drawn much slower because these operations have to be processed by the cpu before being sent to the gpu to draw. So to improve your rendering speed I would suggest you draw a hex image to a canvas at the start of your program and use canvasclip to save that image to an image slot. And then tile that image on the screen rather than drawing each hex grid line by line each time. You should notice a significant speed increase.
Also try to avoid using CanvasClip, WindowClip, and Pixel functions during your rendering loop because all 3 of these functions have to download pixel information from the gpu in order to work which can cause a little slow down if you are using them constantly. This is due to limitations in SDL2 that I had to work around.
|
|
|
Post by eyfenna on Oct 9, 2016 10:30:59 GMT -6
Thanks for the info, goign the path of predrawing all necessary hexagons on and image and displaying them per blit on the screen.
|
|
|
Post by n00b on Oct 9, 2016 23:10:00 GMT -6
I look forward to seeing your changes.
|
|
|
Post by eyfenna on Oct 10, 2016 9:11:27 GMT -6
When I set out to code a strategy game I got a bit hyped and decided to make it all big ... I toned down but in honor of a good action jrpg I think I keep the name Secret of space cows. The version does all before. Changes: - moved from primitive built hexes to images of hexes drawn - the grid is not as perfectly drawn - yet the framerate is gratefull
- now having a total of 10 different hex fields.
- modified the drawImage_HexCell function, added additional functionality and rewrote it to blit in vertical or horizontal or both directions, added two draw orders to draw images that are smaller or larger than a hex cell dimension to either fit their horizontal center on the horizontal center of the hexcell or do this vertically
- all hex functions are in a commented hexfunction.bas file, some still to add, yet I think as soon as it finished making it puplic is a reasonable move
- changed to a include bas file structure as I don't have any other concept for libraries and so far no idea how to write them
- behind the scenes: engines are starting to work, not included as they are undergoing restructuring and fleet command aquired an outdated light cruiser model for later tests
Attachments:SecretofSpacecows.zip (36.3 KB)
|
|
|
Post by n00b on Oct 10, 2016 19:45:22 GMT -6
Your game engine is coming alone nicely. Your framerate significantly increased. I have a section of the website that is suppose to be dedicated to showing off games and demos written in rcbasic. I was going to put my game up there once I have a playable demo and I would love to include your game as well. Its up to you though. In either case, I look forward to seeing a your finished game or even a playable demo.
|
|
|
Post by eyfenna on Oct 16, 2016 10:48:47 GMT -6
- Finally found a version of engines that does work - still some finetuning to do yet does what it should
- Working on the artwork front and learned some things about gimp (round corners and the fun that can be had with layer masks)
- Currently wondering if there is a difference between include lib and include bas
|
|
|
Post by n00b on Oct 17, 2016 3:06:42 GMT -6
There is no difference. You could include a text file and it will still work.
|
|
|
Post by eyfenna on Oct 17, 2016 10:23:27 GMT -6
Hope it runs and i didn't forget any files. Sort of happy I made it to here at least. So what can the player do: - left click on the left (grey) ship see a green hex appear around it, move the cursor around on the field right click and watch the grey ship move slowly around
- left click on the grey ship see a green hex appear around it, left click on a empty hex and see the green hex disappear from the grey ship
- hoover over the END button and see the script colour change, press left click the END button and watch the right (blue) ship move one sometimes two hex to the left
- hover over the plasma button, left click it, see a different crosshair like cursor appear and move that over the blueish ship and left click it to see two turqueous projectiles move on a straight line from left to right
- shut down program and recompile the code and do above again .... some error appears after pressing END button or shooting with turqueous projectiles: can't mark greyish ship long version can't make green hex appear around it .
I think I have everything covered.
From this moment on I need to find a wepspace or something similar, as with all the artwork - about 1 mb - which will grow means I can't post as attachment.
Attachments:SoSC_0-1.zip (993.22 KB)
|
|
|
Post by n00b on Oct 25, 2016 14:53:10 GMT -6
First of all, I want to say I am extremely impressed. The work you have done probably goes beyond what I thought anyone would accomplish in rcbasic. I noticed that you are getting alot of error messages about image slots being empty. I don't think this is an error in the runtime. You might want to go through your code and make sure that when you are trying to do something to an image that there is an image loaded in the slot you are trying to access. To be safe whenever you need to access an image just use 'If ImageExists( image_slot ) Then'. In the future, I will try to set up a way of uploading rcbasic projects to make it simpler.
|
|
|
Post by eyfenna on Oct 28, 2016 7:01:09 GMT -6
First of all, I want to say I am extremely impressed. The work you have done probably goes beyond what I thought anyone would accomplish in rcbasic. I noticed that you are getting alot of error messages about image slots being empty. I don't think this is an error in the runtime. You might want to go through your code and make sure that when you are trying to do something to an image that there is an image loaded in the slot you are trying to access. To be safe whenever you need to access an image just use 'If ImageExists( image_slot ) Then'. In the future, I will try to set up a way of uploading rcbasic projects to make it simpler. I tend to frequently misstype which means I also only got hold of this errors when setting up the project in a new bas file. SInce then I thought about a image tested yet I split the "image space" topical into section like between 0 and 1000 this between 1001 and 3000 this and between 3001 and 4095 that and wrote the loadImage according to topic.
|
|
|
Post by n00b on Oct 28, 2016 8:32:53 GMT -6
Its funny that I point this out because I just started to get the same errors in my own project.
|
|
|
Post by eyfenna on Nov 19, 2016 11:37:16 GMT -6
Currently I'm poking around in the region of combat engines/systems, as I have no expirience with this topic I let you know when I found something suitable for sosc game.
|
|
|
Post by n00b on Nov 19, 2016 15:36:40 GMT -6
I wish I could help you with that but I have not made a game like that before. Good luck though. I am looking forward to a playable demo.
|
|
|
Post by n00b on Jul 3, 2017 17:10:09 GMT -6
Is this still being worked on or has it been abandoned. I thought the initial engine was really impressive and was looking forward to seeing what was going to come of it.
|
|