Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

AppGameKit Classic Chat / Pseudo 3D track with Memblock

Author
Message
SpecTre
Developer
21
Years of Service
User Offline
Joined: 24th Feb 2003
Location: UK
Posted: 29th Apr 2015 23:19 Edited at: 29th Apr 2015 23:20
Well I got really bored with Paint Pot drawing the pictures to colour so I thought I would have a break and see if I could flesh out a Pole Position style Pseudo 3D track.

The code is below and is only the start and not animated yet and no corners etc but all you can see is the road being copied to the screen with Memblocks.

Pictures of the track and background are here too.
Don't get too caught up with the code at this stage as it is really rough and was the first 20 minutes of it!



I got to this stage of just copying the lines of the track before I was going to animate the road, I was going to use a Y offset for the road animation and copy sections of the track from the light and dark parts to create the effect but then when I ran the program, although I got 90 fps on the PC I only got 3.5 fps on the tablet
I was a bit surprised at this as I purposely chose a low res image to test it and only copying 110 lines in the loop at a time.

I think I will have to think of another way of doing this instead of memblocks maybe, unless anyone can see something obvious I am having a senior moment with my brain going dead drawing these Paint Pot pictures lol

Could be quite a good little demo concept if get it going


Image for road:


Image for background:


The Amiga and Amos were great!
Download my game - Paint Pot from Amazon and Google here - http://leap.my-free.website/

Attachments

Login to view attachments
SpecTre
Developer
21
Years of Service
User Offline
Joined: 24th Feb 2003
Location: UK
Posted: 29th Apr 2015 23:20
Image uploaded for background.

The Amiga and Amos were great!
Download my game - Paint Pot from Amazon and Google here - http://leap.my-free.website/

Attachments

Login to view attachments
Markus
Valued Member
20
Years of Service
User Offline
Joined: 10th Apr 2004
Location: Germany
Posted: 30th Apr 2015 00:13
how about split the street in 110 lines x 7 segments/sprites.
sprites: green/white/grey/white/grey/white/green
then position the segments only.

AGK 108 (B)19 + AppGameKit V2 Beta .. : Windows 8.1 Pro 64 Bit : AMD Radeon R7 265 : Mac mini OS X 10.10 (Yosemite)
SpecTre
Developer
21
Years of Service
User Offline
Joined: 24th Feb 2003
Location: UK
Posted: 30th Apr 2015 16:36
Yes I was thinking of sprites as being another way to try it. I was thinking of using 2 sprites to do it, one slice from each of the dark and light sections of the track then starting from the bottom of the screen upwards, pasting these to the screen using scaling maybe.

Anyone able to try the above code on their android device just to see the fps as 3.5fps seems extremely slow though.
It is funny though because it starts off at 60 then gradually runs down to 3.5, I was wondering if it was something to do with keep deleting and creating an image for the display sprite?

The Amiga and Amos were great!
Download my game - Paint Pot from Amazon and Google here - http://leap.my-free.website/
Markus
Valued Member
20
Years of Service
User Offline
Joined: 10th Apr 2004
Location: Germany
Posted: 30th Apr 2015 17:02
fps go down from 20 to 0 at my handy.

AGK 108 (B)19 + AppGameKit V2 Beta .. : Windows 8.1 Pro 64 Bit : AMD Radeon R7 265 : Mac mini OS X 10.10 (Yosemite)
Markus
Valued Member
20
Years of Service
User Offline
Joined: 10th Apr 2004
Location: Germany
Posted: 30th Apr 2015 17:26
example
i add a road with 1 pixel height, but u need to cut the green left & right a little bit more.


AGK 108 (B)19 + AppGameKit V2 Beta .. : Windows 8.1 Pro 64 Bit : AMD Radeon R7 265 : Mac mini OS X 10.10 (Yosemite)

Attachments

Login to view attachments
SpecTre
Developer
21
Years of Service
User Offline
Joined: 24th Feb 2003
Location: UK
Posted: 30th Apr 2015 18:30
Cheers for checking that for me, it seems that the tablet/phone does not like Memblocks too much and copying from them.
I will have to start getting into the method of thinking more re sprites I think as your example runs fast using 120+ sprites and is at 60fps on the tablet.

I thought 3 memblocks and copying from them would be quite efficient but AppGameKit seems to like sprites in general I think.

Cheers for the example with sprites and I will go the sprite way and update when get chance to have another mess with it

The Amiga and Amos were great!
Download my game - Paint Pot from Amazon and Google here - http://leap.my-free.website/
Markus
Valued Member
20
Years of Service
User Offline
Joined: 10th Apr 2004
Location: Germany
Posted: 30th Apr 2015 18:41 Edited at: 30th Apr 2015 18:43
ok.
with the memblocks example is something wrong,
normal it should stay at the same fps.

AGK 108 (B)19 + AppGameKit V2 Beta .. : Windows 8.1 Pro 64 Bit : AMD Radeon R7 265 : Mac mini OS X 10.10 (Yosemite)
SpecTre
Developer
21
Years of Service
User Offline
Joined: 24th Feb 2003
Location: UK
Posted: 30th Apr 2015 23:04
Yes that's why I thought it was a bit strange as if it is gradually eating away memory every cycle.

The Amiga and Amos were great!
Download my game - Paint Pot from Amazon and Google here - http://leap.my-free.website/
Markus
Valued Member
20
Years of Service
User Offline
Joined: 10th Apr 2004
Location: Germany
Posted: 30th Apr 2015 23:57
this line make trouble
mainImageScreen = CreateImageFromMemblock( bufferImage )

AGK 108 (B)19 + AppGameKit V2 Beta .. : Windows 8.1 Pro 64 Bit : AMD Radeon R7 265 : Mac mini OS X 10.10 (Yosemite)
SpecTre
Developer
21
Years of Service
User Offline
Joined: 24th Feb 2003
Location: UK
Posted: 1st May 2015 02:23
Quote: "This command uses a lot of GPU bandwidth so it is not recommended that this command be called every frame on large images."


Just seen this in the commands section.

Hmmmm. Can't think of another way of getting the memblock visible on screen though. Its a shame because I quite like using memblocks. ☺

The Amiga and Amos were great!
Download my game - Paint Pot from Amazon and Google here - http://leap.my-free.website/
SpecTre
Developer
21
Years of Service
User Offline
Joined: 24th Feb 2003
Location: UK
Posted: 5th May 2015 18:29
I am going to do another version of this using this method first:

Quote: "Yes I was thinking of sprites as being another way to try it. I was thinking of using 2 sprites to do it, one slice from each of the dark and light sections of the track then starting from the bottom of the screen upwards, pasting these to the screen using scaling maybe."


before then trying using multiple sprites, however does anyone know of a way to get a memblock to be viewable on the screen without using the slow command here:

Quote: "mainImageScreen = CreateImageFromMemblock( bufferImage )"


It seems memblocks have there uses for detecting areas of an image etc, however when you want to display a memblock it is very limited.

Any ideas anyone, just think for future projects and uses of the memblock commands.


Here is the code again of the CreateImageFromMemblock again from the top of the post:



The Amiga and Amos were great!
Download my game - Paint Pot from Amazon and Google here - http://leap.my-free.website/
SpecTre
Developer
21
Years of Service
User Offline
Joined: 24th Feb 2003
Location: UK
Posted: 5th May 2015 18:31
Maybe a new command to copy part of a memblock or the whole memblock to an existing image might be handy using Render to Image and then this image could be displayed in a screen sprite???

The Amiga and Amos were great!
Download my game - Paint Pot from Amazon and Google here - http://leap.my-free.website/
Conjured Entertainment
AGK Developer
19
Years of Service
User Offline
Joined: 12th Sep 2005
Location: Nirvana
Posted: 11th Jul 2015 19:41 Edited at: 11th Jul 2015 20:26
Quote: "The full version of Paint Pot hits the Apple iOS store today "

Congratulations on that, and best of luck to you.
I guess it's everywhere now, so that monkey is off your back.
Time to celebrate Cheers!

Quote: "Well I got really bored with Paint Pot drawing the pictures to colour so I thought I would have a break and see if I could flesh out a Pole Position style Pseudo 3D track."

I am working on a car driving game now too. (I love Pole Position)
I was torn between doing a racer or a demolition derby, so I am doing a top down style racer with a demo derby for a bonus level.
I was going to do the Pole Position style, but ended going top down for the derby's sake.

Quote: "i add a road with 1 pixel height, but u need to cut the green left & right a little bit more."

I saw a snippet somewhere online for that type, but his was 7 pixels high if memory serves.


Coding things my way since 1981 -- Currently using AppGameKit V2 Tier 1
SpecTre
Developer
21
Years of Service
User Offline
Joined: 24th Feb 2003
Location: UK
Posted: 11th Jul 2015 23:03
Quote: "I guess it's everywhere now, so that monkey is off your back."


Yes glad I have finished now, just the lite version to put on iOS store. Maybe a few more pictures now and again too when get the chance between doing other stuff

Doodle Draw next.

Quote: "I am working on a car driving game now too. (I love Pole Position)"


Will look out for that, should be a good project
Forgot I did this thread lol, might come back to this soon!

The Amiga and Amos were great!
My website LEAP - Download Paint Pot here!
xGEKKOx
AGK Master
15
Years of Service
User Offline
Joined: 7th Dec 2008
Location: Italy
Posted: 12th Jul 2015 06:38
Well Spectre, the best way to draw pseudo 3d road is to do a Sprite height of 4px and to repeat it until the bottom of the road.
You must calculate the left and right part of the road, and the middle.

Moving left and right from the middle those sprites, will make a road seems like curving.

I started in the past this project too, but abandoned for the slowness of too many sprite on the screen.
But i'm very curious if now it go fast.

SpecTre
Developer
21
Years of Service
User Offline
Joined: 24th Feb 2003
Location: UK
Posted: 12th Jul 2015 13:27
@Gekko,

yes I might have another go at this when Doodle Draw is done

The Amiga and Amos were great!
My website LEAP - Download Paint Pot here!

Login to post a reply

Server time is: 2024-09-29 01:16:01
Your offset time is: 2024-09-29 01:16:01