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 / What basic engine would people like to see developed?

Author
Message
Santman
13
Years of Service
User Offline
Joined: 15th Sep 2011
Location: Inverness
Posted: 24th Oct 2019 01:57 Edited at: 4th Nov 2019 18:11
So I need a break from my current project, and wondered if there was any particular type of game engine that people have been struggling with? I got the kids a Switch recently, and they;ve been obsessed with Splatoon, which I don't actually think would be hugely difficult to code the basics of.

Is there anything like that kind of basic game engine people are struggling with?

UPDATES:
Tomb raider / 3D platformer
Ok, so attached here is the basic 3d platformer code. This is a lift from my world builder, so the model is incomplete (the world builder uses modular characters with interchangeable heads and hair) and some of the code is still a bit unrefined around the camea, however is shows how a full Tomb Raider style 3rd person code might work. I also added a new mode, since it was asked for, that toggles it to a straight forward side on 3D platformer - you can toggle these at will with F1.

Background loading (limited)
Also is a seamless loading routine. Essentially this uses memblocks to "stream" in files in the background. Best I can do with a single thread on T1. Workds with images, models and sounds, and for small files it works great. If you use it in T2, you can load MUCH MUCH faster as you can do more cycles per frame.

Bomberman
I found my Bomberman example that I did for fubarpk's game jam thing - so I uploaded that as well, just in case anyone wants it.

Attachments

Login to view attachments
Xaby
FPSC Reloaded TGC Backer
17
Years of Service
User Offline
Joined: 17th Apr 2007
Location: Berlin
Posted: 29th Oct 2019 07:12
- 2D non Box2D based Platformer
- 2.5D platformer, 2D Sprites and 3D objects combined
- 3rd person like the first Tomb Raider
- videoplayback based racing car like MEGARACE
- RPG with items, inventory system, dialog system, quests, mobs (Zelda like)

A Splatoon 2 like shooter with coloring the 3D space would be a fun thing. I think the 3rd Person Tomb Raider would be needed and the decalls for the splashes.
It would be also possible, to integrate later fast fluid and jump fluid like in Portal 2 with that technique.
Loktofeit
AGK Developer
15
Years of Service
User Offline
Joined: 21st Jan 2009
Location: Sarasota, FL
Posted: 29th Oct 2019 20:52
One that works with GameGuru files.
basicFanatic
7
Years of Service
User Offline
Joined: 7th Jun 2017
Location:
Posted: 29th Oct 2019 22:30
I tried to create a 3D shooter, but couldn't figure out how I was suppose to add WASD movement using the 3D physics.
Another failed project that I might return to is trying to code a text adventure. It's a bit more advanced than I had initially expected.
Santman
13
Years of Service
User Offline
Joined: 15th Sep 2011
Location: Inverness
Posted: 30th Oct 2019 21:32
Xaby,

I'm curious....a non box2d platformer? What do you mean?
Xaby
FPSC Reloaded TGC Backer
17
Years of Service
User Offline
Joined: 17th Apr 2007
Location: Berlin
Posted: 31st Oct 2019 06:54 Edited at: 31st Oct 2019 07:10
@Santman,

I guess, the collisions in the first place don't need Box2D, it would also be possible to have slopes and what not in some kind of array without a physics-world.
http://higherorderfun.com/blog/2012/05/20/the-guide-to-implementing-2d-platformers/



the other idea is, to have a "3D" system, where the camera is fixed, and the background is pre-rendered like in Resident Evil for the GameCube. (also PS1, but I guess, that makes no difference these days with that visual quality in mind)
Santman
13
Years of Service
User Offline
Joined: 15th Sep 2011
Location: Inverness
Posted: 31st Oct 2019 13:53
Well, the world builder I'm working on has both a basic third person and first person game mode included for testing, which kind works like tomb raider, with camera working and platforming collision etc all working. Camera is a little janky though, but easily fixed. Shall I upload the basic for a 3d platformer?

For the 2d platformer, going by your screen shot, is it just detecting the point on the y axis to place the player Sprite? Doing 3d backgrounds with a 2d Sprite would actually be dead easy, easier than 2d as you can ray cast.

Xaby
FPSC Reloaded TGC Backer
17
Years of Service
User Offline
Joined: 17th Apr 2007
Location: Berlin
Posted: 1st Nov 2019 09:28
The basic for a 3D platformer would be great.

Maybe with an example level, where you can jump on a box or so
Santman
13
Years of Service
User Offline
Joined: 15th Sep 2011
Location: Inverness
Posted: 1st Nov 2019 13:28
I've already got that, so ill pull it out the world builder and put something up this weekend.
janbo
16
Years of Service
User Offline
Joined: 10th Nov 2008
Location: Germany
Posted: 1st Nov 2019 14:56
Quote: "Splatoon, which I don't actually think would be hugely difficult to code the basics of"


Are you also talking about that painting on the world surface thing ?
I can paint on any object surface, but I'm interested how you'd do this ?
composersky
5
Years of Service
User Offline
Joined: 1st Nov 2019
Location:
Posted: 1st Nov 2019 18:46
I need a seemless loading and saving areas endless tile map, and a good text engine that lets me click on words like hyperlinks.
Santman
13
Years of Service
User Offline
Joined: 15th Sep 2011
Location: Inverness
Posted: 3rd Nov 2019 01:54
I've added an exmaple of both a 3rd person Tomb Raider style of code, and a side on 3D platformer to the fisrt post.

Janbo,
Yes, the paonting on the world surface. Splatoon on the Switch is very pretty, but if you look at the world some key points come out:
1) not every surface is paintable
2) The levels are large, but made up of small numbers of platforms, which are largely block based
3) paintable surfaces tend to be either blocks or cylanders
4) piant only applies to flat surfaces that are hit (they do not run down horizontal platforms to vertical ones etc)
5) more complex paintable surafaces / objects tend to have a set texture that just overlays it

So there's only really two major problems to the Splatoon system; how to paint a surface and how to detect collision with the painted surfaces for the squid abilty.

Problem 1: painting the surfaces.
The issue here s that all "splats" are permanant, and aren;t linked to the camera (so a method similar to that sued for casting shadows would likely not work or be very slow - or I think, at least). I don't think this is rocket science: every surface has a data file mapping the UVs of the paintable elements, and every object has a seperate render image all stored in an array. Once that's set up, it's a fairly straight forward case of raycast to detect collision, get the surface normal to tell which side of the object was hit (I did this axact method in the minecraft engine I built to detect collisions within the world), then paste a sprite into the render image based on offset coords.

Problem2: detecting collision with paint
Again, fairly easy. I would simpley create a custom shader (or an option within a shader) to only render the paint splatter layer, from the render images. Set the camera to the player position, set it to look at the floor then move it slightly backwards. Render that to a special image, lets say 5*5 pixels, then convert that to a memblock (tiny image so it'll be super fast) and read the center pixel; if it's not empty then your standing in paint. To increase accuracy you'd just need to increase the size of that image. In fact, this method is likely the same as checking for characters moving through water etc.

So for Splatoon, I don't think it;s too much work to be fair, the effort comes from the shaders to merge the splt textures and create good looking normals. I may turn the attached example into a simple Splatoon demo once I get the World Builder to Alpha. I hope you're on the mend BTW.
Santman
13
Years of Service
User Offline
Joined: 15th Sep 2011
Location: Inverness
Posted: 3rd Nov 2019 02:00
composersky,

Seamless loading - I've attached an old example I built...it's only possible in T1 through memblocks. Or at least, I don't see another method.In this example click the left mouse button to start streaming; this then loads a small and VERY large image back and forth, but "streams" them in using memblocks so there's no slow down or pause of the main code. The disadvantage is that the memblocks are very large, and they take much longer to load. Works great for small images and models though.

Not quite sure what you mean for the other two things? An endless tile map and hyperlinks?
Santman
13
Years of Service
User Offline
Joined: 15th Sep 2011
Location: Inverness
Posted: 3rd Nov 2019 02:17
Xaby,

Just thinking about you're request for a 2D platformer with non box 2d collision that works for any shape; I think that idea about rendering the base of the player to a small image and then converting it to a memblock might work there too actually. You'd just draw ONLY the ground and objects which can be stood on, and clip them all to the bottom Y coord of the player sprite, and a box that is the size of the maximum distance the player can drop. Then once you have it as a memblock, just read vertically down from the top until you find a used pixel, and boom - that's the exact height at which the player impacts the ground.

No box 2D commands.
composersky
5
Years of Service
User Offline
Joined: 1st Nov 2019
Location:
Posted: 3rd Nov 2019 04:31
Well, with seamless tile map loading/saving I mean it loads the map off the disk, as you move close enough to a new area, left,right,up,down,etc. on a tile grid map, and saves the map to the disk as you leave far enough behind an old area when it's far enough offscreen. I'd like to design a map with lots of tiles and characters, but without the saving/loading screens you get moving from one area to another. With big maps you have to save stuff to disk in the background if possible too so it doesn't pause while loading and saving is going on.

Think of a map grid like this with sectors A B C D E. Then below that F G H I J K, etc. 5x5 sectors. Each sector is 10x10 map tiles. A is the far point west/left, where you load the new area if you approach it enough, E is the far point right, where you save the old area if you get away from it enough. C is the center where the character always is. I guess that's one method. I am sure there are more efficient method for getting new areas off the disk and saving old. Instead of whole sectors, maybe always just a column or a row as you move. It'd be most efficient done in the background so the game doesn't freeze up. I really should read up on how to efficiently do programming things, even if I am a terrible programmer, I know the straightforward ways tend to work poorly and bog things down. I know I can't check every tile of a large enough map grid every loop iteration in a tile based map once it gets large enough, those dense rows and columns add up, so there has to be efficient ways to handle checks too.

Anyway some of the map has to be offscreen loaded so you can still have things happening there, i.e. characters moving and doing things that you see the results of when you move close enough. So you have to figure out, what's the efficient amount.

I also have ideas for heavily text based type game stuff, where while there's an overmap, and the text area with a description of where you are below you click on the text that is a different color -- objects that are highlighted in the text, a different color than the rest of the text, and popups of more information about that object appear. Maybe text is just a different color, maybe there's a sprite under the text to make it more notable. Something like that. Since you would do this a lot, I'd have to assign the word in the text an identifier and precisely highlight or indicate it, then retrieve the info text about it when clicked. This would be good for wordy detective and novel like games. I used to play interactive fiction games. But this is sortof like a webpage really, clicking links to trigger something to happen.

I.e. you move over the overland map, then the text area description changes, and you see highlighted points you can click for more information, maybe pickup and object, maybe see a person's description. Since I am a heavily text based guy with lots of describing things this is a useful type of engine for me.
Xaby
FPSC Reloaded TGC Backer
17
Years of Service
User Offline
Joined: 17th Apr 2007
Location: Berlin
Posted: 3rd Nov 2019 08:01
Do the world would have to exists two times to be able to have a mirror or a Portal like in Portal 1 & 2?
Santman
13
Years of Service
User Offline
Joined: 15th Sep 2011
Location: Inverness
Posted: 3rd Nov 2019 11:09
Composersky,
Still a little muddled as to the tiled ask, but I think you mean something like the settlers? If so then the two asks are very different, graphics and what's happening offscreen because they are not linked. Before I moved to 3d I was doing a civ game that had a large tile based map, shown here


If you skip ahead a bit, you'll see the map scope. That has only tiles visible on screen generated at anytime, as you scroll it creates new rows in realtime. It does this by always having (from memory) two rows and columns more than needed, then if you scroll cutting of a row and building a new one. Is that what you mean?
In terms of tracking stuff off screen, in the settlers example the original settlers game could track thousands of little people, but it will all have been data waypoints and calculations. For example, if a settler had to move from point A to point B, the time it should take would be calculated and a way point created at that system time. Now, the settlers passion would be 100% calculated by how much time had passed since it got the order as a percentage of the total time needed, then the sprite would be positioned, if needed, that percentage of the way to the destination. Pretty much how it would happen for something like, say, Fallout, but with added links to time of day.
Santman
13
Years of Service
User Offline
Joined: 15th Sep 2011
Location: Inverness
Posted: 3rd Nov 2019 11:17 Edited at: 3rd Nov 2019 11:45
Xaby,

Mirrors and Portal are two different things in my view, potentially. Mirrors can just use screen space reflections now. In my recent videos, where I made the water reflective, I didnt use them as a) it's very complex, b) it only reflects what is on screen (so a tree behind the player may not reflect if clipped etc). I used a different method as I needed only the water plane to reflect, and wanted perfect reflections and control over what reflected. Janbo or Garbor are the guys for that.

For Portal, that's far more complex. I'd have to play around with it but it's probably similar to the method is used for my water. Youd have to move the camera to the exit portal, adjust for the angle of the portal to the player camera, render the scene to an image, put the camera back and then apply the image to the entrance portal. Where it would get complicated is with recursion; where you get that mirror in a mirror style endless effect. My guess is that would require multiple render passes. Maybe that's why the portal world was always quite fundamentally simple???
Santman
13
Years of Service
User Offline
Joined: 15th Sep 2011
Location: Inverness
Posted: 3rd Nov 2019 11:52
Actually I've been thinking about the portal idea....it would be more simple than I said as I dont think youd have to worry about camera angles as it would inherently be correct, it would just need quite advanced clipping and camera positioning.

Might be fun to try it.
Xaby
FPSC Reloaded TGC Backer
17
Years of Service
User Offline
Joined: 17th Apr 2007
Location: Berlin
Posted: 3rd Nov 2019 12:20
@Santman,

did you released your editor somewhere? Would it be possible, to use it also for platformers and maybe integrate some other stuff?
Santman
13
Years of Service
User Offline
Joined: 15th Sep 2011
Location: Inverness
Posted: 3rd Nov 2019 12:41
It's going into alpha soon with the people that answered the poll.

One of the features that it will have is the option to choose world shape....so instead of the big 8x8 grid, you could have up to 64 chunks in a line to create a side scrolling level. The code I did for this thread will go into that.

I'm going to build an export option that let's you choose elements, so you wont have to export the landscape or ocean etc....you can just use it to build internal scenes etc as a placement editor.

The builder will come with full basic code....just what's in this thread.

What else would you expect to see in it?
fubarpk
Retired Moderator
19
Years of Service
User Offline
Joined: 11th Jan 2005
Playing: AGK is my friend
Posted: 4th Nov 2019 06:40 Edited at: 4th Nov 2019 06:41
Quote: "What basic engine would people like to see developed?"

The world builder definitely would be up there

On a different note ide like to see a good mist shader that you could apply an area for the mist and colour
which for example might just be 1/4screen in 3D I think I could almost manage something in 2D
fubarpk
fubarpk on Itch...………...https://fubarpk.itch.io/
fubarpk on googleplay..https://play.google.com/store/apps/developer?id=fubarpk
Santman
13
Years of Service
User Offline
Joined: 15th Sep 2011
Location: Inverness
Posted: 4th Nov 2019 09:09
I was meaning more game engines that's people were struggling with, not shader requests.

But do you mean like volumetric fog? I think that would be really difficult with our version of opengl as your essentially trtting to shade part of 3d space that's not an object. For example, I make a big cube, then give it a shader that renders a height based fog effect. Great. But what happens when you move inside it? Janbo did a think about it if I recall.

You could probably do something quite spooky fairly easily with particles that might do the job though?
fubarpk
Retired Moderator
19
Years of Service
User Offline
Joined: 11th Jan 2005
Playing: AGK is my friend
Posted: 4th Nov 2019 09:29
Thanks

The new particles might do it but haven't the money to purchase that yet
fubarpk
fubarpk on Itch...………...https://fubarpk.itch.io/
fubarpk on googleplay..https://play.google.com/store/apps/developer?id=fubarpk
janbo
16
Years of Service
User Offline
Joined: 10th Nov 2008
Location: Germany
Posted: 4th Nov 2019 12:24 Edited at: 4th Nov 2019 14:01


Now this works on complex meshes to. But transitions from one triangle to another needs a good UV map.
One could probably check for all triangles in a specific area and calculate the texture position for each detected collision... But that's for when we create a splatoon game
I don't like the "look down and scan the memblock for a color" method its to error prone for my taste.
I'd prefer a projected decal system for that stuff...but in deferred rendering it would be alot easier.
Santman
13
Years of Service
User Offline
Joined: 15th Sep 2011
Location: Inverness
Posted: 4th Nov 2019 12:38
Fubarpk,

Existing particles would work well enough for fog. Where they fail badly is in depth and decals you dont always want to look at the camera.

Janbo, that's in essence the exact idea of what I think they based it on, but that's still some nice work. How would a projected decal system work for detecting if the player was standing in an area that was inked? I guess you could use the exact same method as painting, but instead of painting a decal, somehow read the data, but that would need a memblock would it not? It would also be a large memblock potentially, so converting it every frame might be slow. Or even every other frame.

janbo
16
Years of Service
User Offline
Joined: 10th Nov 2008
Location: Germany
Posted: 4th Nov 2019 13:57 Edited at: 4th Nov 2019 16:10
Projected decals would use an object where you render it into. So you scatter around some objects and use simple object collisions I guess.
I tried it once and failed

[Edit]
Santman wrote: "I make a big cube, then give it a shader that renders a height based fog effect"

You would use a fullscreenshader and ray march through a "virtual" box which got calculated inside your fullscreen shader, you then use this "virtual" box, which has no mesh data and only exists inside your shader, as your sandbox.
You can then let your imagination run wild. simple ground fog should be easy, but for clouds you'll need 3D textures, which we dont have in AppGameKit and calculatin them inside the shader is a performance killer. There are work arounds for 3D textures for example You could probably create really large texture atlases which assembles your 3D texture.

But you are right you can also just use a box object and calculate ground fog for it but then you can't go inside it...true ...its like the deep sea fog for my Water shader or Ocean shader.

Also...regarding the splatoon thing: Render the ground into a 1 by 1 image using an orthographic camera and then read that pixel color is probably a very fast method. I Just didn't like the color part. I want a unique ID to make out the splat or what ever one uses this system for. maybe I want to blend two colors if they meet or something.
[/Edit]
Santman
13
Years of Service
User Offline
Joined: 15th Sep 2011
Location: Inverness
Posted: 4th Nov 2019 18:11
Projected decals - I see how that would work for the world (though in Splatoon the ENTIRE world can be painted, hence the need for a permanent solution), but how would that help you detect collision with a previously painted decal area?

Ah, I;ve never really touched ray casting in shaders yet, that's still beyond me.
fubarpk
Retired Moderator
19
Years of Service
User Offline
Joined: 11th Jan 2005
Playing: AGK is my friend
Posted: 4th Nov 2019 18:35 Edited at: 4th Nov 2019 18:53
Almost but not quite maybe with a texture but im prob doing something wrong


Just a thought
If your loading in an object from an obj you know all the faces, I think puzzler was on the way to this as
his method of recreating the object knew all the tris so finding the right one and modifying the texture was
very close I think. But his OBS object modeller only got as far as colouring according to the layout in the mtl
file. If you had a mtl file with every face coloured differently it allowed just what you want but not the best method
If you chose to go down that path blinks Kenny converter may be a good start and is available on the forums.
fubarpk
fubarpk on Itch...………...https://fubarpk.itch.io/
fubarpk on googleplay..https://play.google.com/store/apps/developer?id=fubarpk
janbo
16
Years of Service
User Offline
Joined: 10th Nov 2008
Location: Germany
Posted: 4th Nov 2019 19:03 Edited at: 4th Nov 2019 19:15
Quote: "knew all the tris so finding the right one and modifying the texture was very close I think"


For my Mesh Drawing Demo, I posted the video above, I'm reading the Vertex and index data of the whole object I have all informations filled into a custom Datatype.
With the UV data of the triangle, I am currntly in with my "cursor", I calculate the barycentric coordinates to find the right position on the texture.
Then I combine the brush I want to use with the objects texture and draw it into a RenderTarget.
If you take a look into the SP_MeshManipulation file from my shader pack you'll see there is everything you need to read mesh data and create meshes with all combinations of AGK's standard Vertex Attributes and some Custom ones too, which you can let it generate automatically...like smooth normals or barycentric coordinates for the wireframe shader.
I had to make preparations for some shaders

@Santman: Projected decals can be permanent, just don't delete the object you are projecting into. You could even attach them to moving objects.
Santman
13
Years of Service
User Offline
Joined: 15th Sep 2011
Location: Inverness
Posted: 4th Nov 2019 20:40 Edited at: 4th Nov 2019 20:45
So, here is (one small custom shader later) a pixel perfect way to detect collisions with any textured surface.



This uses a 7x7 render image, so would work perfectly for the pixel perfect sprite detection with no box 2D as well.

So that's us Janbo....we just made the basics of Splatoon on PC...now let's go rich! Lol.
Santman
13
Years of Service
User Offline
Joined: 15th Sep 2011
Location: Inverness
Posted: 4th Nov 2019 21:11 Edited at: 4th Nov 2019 21:11
And here's some fog just for fun (only a 5 minute effort).....

Santman
13
Years of Service
User Offline
Joined: 15th Sep 2011
Location: Inverness
Posted: 4th Nov 2019 21:40
I just had a brainwave.....you could actually do the calc for that slime collision in the shader, then output a 1x1 pixel image of either black for 0, and white for 1.....and do almost the entire calculation inside the shader itself and need only the memblock to get the "answer".

This seems perfectly fast though.

Next up.....portals.
fubarpk
Retired Moderator
19
Years of Service
User Offline
Joined: 11th Jan 2005
Playing: AGK is my friend
Posted: 5th Nov 2019 05:51 Edited at: 5th Nov 2019 06:04
You did well with the fog us mere mortals take longer

If you can detect paint splodges like that with pixel perfect collision I wonder if the method
would work for a navmesh system as you would have the ground texture and possibly know
where the buildings are a separate texture perhaps for collisions and navigation system
fubarpk
fubarpk on Itch...………...https://fubarpk.itch.io/
fubarpk on googleplay..https://play.google.com/store/apps/developer?id=fubarpk
janbo
16
Years of Service
User Offline
Joined: 10th Nov 2008
Location: Germany
Posted: 5th Nov 2019 07:08 Edited at: 5th Nov 2019 07:21
@Santman: I was wondering why you thought you'd need a 7x7 render terget, but now you at the same 1x1 as me, did you use an ortographic camere too.
Sure you can use a shader to encode the coolor values from an Splat ID into a color and after decoding you'd have an Integer worth of ID's.
Not sure what to do with all those ID's but there you have it:
Encode Color in Shader


Deferred rendering and decals would also allow you to easily apply normal/bumplamming to the splats/decals so it looks like they have some depth.
I have my work arounds here too...

Here for example I draw a highmap and place the data into the alpha channel of the diffuse texture
This is Parralaxmapping and gets away with only a single texture sampler...one can calculate the normal from this hightmap/channel like I did in my terrain shader.
I'm just combining some techniques of my own shader pack the whole time

Upload your Demo on Github !
Santman
13
Years of Service
User Offline
Joined: 15th Sep 2011
Location: Inverness
Posted: 5th Nov 2019 08:21
Fubarpk.....in fairness my world builder has a visual editor for Classic particles built in, so it makes it fairly easy. Otherwise its have taken way longer.

Janbo, now that is sexy. If you invert the normal and gave it a bumpy surface, youd have a near perfect splatoon effect with that. Nope, no ortho camera, didnt need it as the clip distance is so short it works regardless. Using a 7x7 allows multiple things - for example you could test each corner to make sure the player is properly in the painted area and not some random dot.

I dont use github.
janbo
16
Years of Service
User Offline
Joined: 10th Nov 2008
Location: Germany
Posted: 5th Nov 2019 08:32 Edited at: 5th Nov 2019 08:45
Quote: "for example you could test each corner to make sure the player is properly in the painted area and not some random dot"

I think of it like a raycast for color detection. If I'd want to test the bounding box of something I'd do the 1x1 Color Cast 4 times, no matter how large the bounding box is, it would cost the same for a box thats very small. And I'd use Otho through...stairs might screw things up for a projection camera, but with an Color cast starting from a higher place using orthographic camera stairs can't make problems.
Design your functions,snippets,icludes so you can use them for as many thinks as possible.

Quote: "I dont use github"

And what if I recommend it to you
Santman
13
Years of Service
User Offline
Joined: 15th Sep 2011
Location: Inverness
Posted: 5th Nov 2019 09:09
Quote: "Design your functions,snippets,icludes so you can use them for as many thinks as possible."


As a rule I agree and do.....but in this instance I'm not convinced the time taken to reposition the camera four times and make four render calls would be better, and this gives flexibility.....but both should be super fast if you clip the camera short enough. You could just add parameters to the function, then get best of both....but sometimes you just need dedicated code

Rik gave me access to the AppGameKit once upon a time and I used it briefly, but didnt really need it to be honest.
composersky
5
Years of Service
User Offline
Joined: 1st Nov 2019
Location:
Posted: 5th Nov 2019 09:28 Edited at: 5th Nov 2019 09:31
I was just meaning something more like a standard x/y tile map, with a centered player, with a lot of visible tiles surrounding that move with the player still in the center. I guess I went into too much detail about figuring out ways to load/save the bits offscreen far enough efficiently.

I am getting into the swing of this I think I can do it on my own, it's been a bit since I delved into programming I had to wrap my mind around it again.
janbo
16
Years of Service
User Offline
Joined: 10th Nov 2008
Location: Germany
Posted: 5th Nov 2019 09:36 Edited at: 5th Nov 2019 09:40
Quote: "but sometimes you just need dedicated code"

Sure it's to early...we are in the prototyping phase...wasn't meant as criticism.

Regarding Github: Too bad, I'd like to look over/work with you on it. Github is REALLY great for this.
Santman
13
Years of Service
User Offline
Joined: 15th Sep 2011
Location: Inverness
Posted: 5th Nov 2019 10:58
composersky,
The bomberman code does this.....the level wills scroll and keep the player centred. Using camera offset, it's quite easy with AGK.

Janbo,
If you fire me something over I can easily download the app again, if it would make collaboration easier.
janbo
16
Years of Service
User Offline
Joined: 10th Nov 2008
Location: Germany
Posted: 5th Nov 2019 11:05
Quote: "If you fire me something over"

Don't understand...should I setup a/the Github Project ?
Santman
13
Years of Service
User Offline
Joined: 15th Sep 2011
Location: Inverness
Posted: 5th Nov 2019 16:57
I can set one up.

Wont be tonight though, off to the bonfire with the kids.
Santman
13
Years of Service
User Offline
Joined: 15th Sep 2011
Location: Inverness
Posted: 8th Nov 2019 23:02
So it took a little bit mor time than expected, but here's a very basic, cube based Splatoon style game video. Uncapped, it runs at about 500fps, so this is more than fast enought to do on mobile. Not only does it have texture raycasting to detect collisions with decals, but this also allows infinite painting of the world as well. Also there's changable paint splat sizes - you'll see that in the top left corner. You could, for example, make a bomb that filled a HUGE amount of ground with paint, or do brushes, or sweeping, or anything else - it works through simple casting, so you could in theory paint any shape or size.

Santman
13
Years of Service
User Offline
Joined: 15th Sep 2011
Location: Inverness
Posted: 8th Nov 2019 23:06
Xaby,

I've been thinking about the sprite collission without box2D. The example above on how to detect the slime collision would work fine....however the only issue would be how to zero in on the point of contact correctly. I think the only way to do it would be to scale the camera offset and position it at the exact point of impact you want to detect - for example the sprites feet - and then do the render. That way you would get one memblock that would allows you to scan in all directions. For bullets and such, you could follow a vector through the memblock by only rendering the sprite you want to detect the impact with.

Only way I can think to do it, without using a shader to do it and rendering a binary output.
Xaby
FPSC Reloaded TGC Backer
17
Years of Service
User Offline
Joined: 17th Apr 2007
Location: Berlin
Posted: 12th Dec 2019 11:02
@Santman

Something like that would be easy to do with an Array


But I am stuck, how to do it the best way for non array based Collisions without checking collisions agains every other Sprite




So for a Platformer, RPG or anything, maybe like Bomberman or so, it would be interesting, how to be able to optimise the collisions.

My idea is, to check next to each side with GetSpriteHit(X, Y) and if there is any Sprite in the same hit-group or category. (don't understand exactly what the difference is)

But e.g. for a Circle-Shape, I don't know, how to check it correctly. So maybe I am overthinking this, or I would have to have more collider-helper-"Sprites"

Attachments

Login to view attachments
janbo
16
Years of Service
User Offline
Joined: 10th Nov 2008
Location: Germany
Posted: 12th Dec 2019 13:40 Edited at: 12th Dec 2019 13:44
@Xaby:
For grid based maps you don't have to check every sprite with your character sprite.
It's enough when you just check the sprites around you, right ?


For non grid based maps you could assign the sprites into rectangles and use Octrees to find them.
Bengismo
7
Years of Service
User Offline
Joined: 20th Nov 2017
Location: Yorkshire, England
Posted: 12th Dec 2019 14:19 Edited at: 12th Dec 2019 14:20
Janbo: Thats exactly what I do in my platformer code and it works perfect.

Basically work out what tiles you could be overlapping and just check those....typically you only end up checking 4 tiles.

The collision shapes for any sprite in AppGameKit can be set so you can always do collisions between a player and a non square tile and it just works. So sloped tops or round tiles still work fine.
Santman
13
Years of Service
User Offline
Joined: 15th Sep 2011
Location: Inverness
Posted: 12th Dec 2019 18:01
Do collision shapes work per pixel?
Bengismo
7
Years of Service
User Offline
Joined: 20th Nov 2017
Location: Yorkshire, England
Posted: 12th Dec 2019 18:09 Edited at: 12th Dec 2019 18:10
Not by default....they work by the sprite shape set (up to 12 point convex shape) - which is normally enough for a tilemap shape

I shared a per pixel sprite collision algorithm a while back which works fine but wasnt fast- put it in teir 2 or a plugin and its great.

Login to post a reply

Server time is: 2024-11-22 11:39:14
Your offset time is: 2024-11-22 11:39:14