Coder, video game industry veteran (since the '80s, ❤'s assembler), arrested - never convicted hacker (in the '90s), dad of five, he/him (if that even matters!). https://deluxepixel.com
Cool, does it use bump? I see there is bump.lua in the file list but I am on mobile right now. Bump is native since some gideros release ago I think you can remove that file and use the plugin. also, adding bump word in this topic will make it easier to find it later
Yes, I certainly can add your custom response to native bump, One way platforms are so common with platformers that even original bump should have included it at first. i would call it platform instead of oneway though.
I downloaded the demo from Github and tried to run it with the latest Gideros 2018.1.1. Got an error:
./Stuff/bump.lua:43: x must be a number, but was nil(a nil)
stack traceback:
./Stuff/bump.lua:43: infunction'assertType'
./Stuff/bump.lua:54: infunction'assertIsRect'
./Stuff/bump.lua:617: infunction'add'
Stuff/Platformer.lua:10: infunction'init'[string"property.lua"]:52: infunction'__new'[string"property.lua"]:46: infunction'__new'[string"property.lua"]:59: infunction'new'
Scenes/GameScene.lua:68: infunction'loadLevel'
Scenes/GameScene.lua:15: infunction'init'[string"property.lua"]:52: infunction'__new'[string"property.lua"]:59: infunction'new'
main.lua:8: in main chunk
I tried to require "cbump" instead of the Lua Bump, and then I get this error:
Scenes/GameScene.lua:43: attempt to index field 'responses'(a nil value)
stack traceback:
Scenes/GameScene.lua:43: infunction'setupWorld'
Scenes/GameScene.lua:12: infunction'init'[string"property.lua"]:52: infunction'__new'[string"property.lua"]:59: infunction'new'
main.lua:8: in main chunk
Would be great to get it working out of the box, to show people new to Gideros.
It doesn't work with native bump, for some reason. I removed custom response function, fixed "Item ray must be added to the world before getting its rect" error, and now player just crushing...
jMaybe it's a bug in the Gideros c version of Bump?
Yeah, in my case world:project(...) works in lua version without adding item to the world, but cbump requiring to do so. Btw, this example will not work with native verion, because of custom response function.
I think I would need this "custom response function" ability I implemented moving platforms, that works great on horizontal moving platforms but not if they move vertically
I think I would need this "custom response function" ability I implemented moving platforms, that works great on horizontal moving platforms but not if they move vertically
Technically it is possible (using luaL_ref/luaL_unref), but requires alot of changes.
(at) rrraptor bump.lua you are using (which I have included in my test platformer) and gideros cbump are not behaving the same at all I have two sample cases: - bump.lua, when I am on a vertical moving platform I can jump when the platform is either going up or down which is super cool - gideros cbump, when I am on a vertical moving platform I can only jump when the platform is going down
- bump.lua collisionfilter doesn't work as expected, that is the last elseif statement is always executed even if it doesn't collide at all - gideros cbump collisionfilter works as expected
It is a shame because I would need a mix of bump.lua and cbump I am investigating and trying to find where guderos cbump and bump.lua differ. I will also try to make a sample project to show exactly what I mean.
Here is my collisionfilter function (pass through platforms work out of the box without custom collisions)
self.collisionfilter =function(item, other)-- "touch", "cross", "slide", "bounce"if item.isplayer1 thenif other.isnme thenreturn"bounce"-- NOT TESTEDelseif other.isground thenreturn"slide"-- TESTS OKelseif other.isladder thenreturn"cross"-- TESTS OKelseif other.isptpf then-- TESTS OKif item.isdown thenreturn"cross"end-- go down on key down pressedif item.body.vy >0then-- going downlocal itembottom = item.y + item.h
local otherbottom = other.y + 8-- treshold magik XXX +2if itembottom <= otherbottom thenreturn"slide"endendelseif other.ismvpf then-- TEST OK WITH BUMP.LUAif item.body.vy >0then-- going downlocal itembottom = item.y + item.h
local otherbottom = other.y + 8-- treshold magik XXXif itembottom <= otherbottom thenreturn"slide"endelsereturn"cross"endelseif other.isspring then-- TESTS OK WITH GIDEROS CBUMPif item.body.vy >=0then-- going downprint("xxx", item.body.vy)-- IN BUMP.LUA THIS CODE IS ALWAYS EXECUTED!!!return"bounce"endendendend
I am very interested in the ECS template and I have tried to use it and plan to do more. But I can't always decide for myself how correctly to break everything, how small. Here is an example of my splitting into character management systems (made on a different engine and with its own ECS implementation library).
Here I have divided each state into a separate system, the movement is also divided into systems for acceleration, braking and movement. I proceeded from the rule: divide everything. On using a separate system for the state, I read here: https://www.richardlord.net/blog/ecs/finite-state-machines-with-ash.html . As a result, there are a lot of small pieces and it's probably better to combine some pieces anyway. Otherwise, it becomes difficult to control such a quantity.
@E1e5en I am new to ECS, I have examined rrraptor's ECS project https://github.com/MultiPain/Gideros-tiny-ECS, I watched many videos explaining ECS plus read some articles about it. The way I do it right now: - entities have unique id - entities can have components - systems act on components (thus entities)
Will try to post my take on ECS asap
I don't use state machine yet because it seems I don't need it so far and that would complicate my code?!
There is nothing complicated in the template itself. This can be called functional programming, where independent functions (installed in a certain sequence) simply change data (components), depending on other data (components). And the systems (functions) that relate to the engine simply use data from the components and api of the engine. The very essence is simple, but a good organization of these components and the system is a headache. Therefore, it will be interesting to look at your solution. And the right decision will come only with experience, you need to practice using this template more.
There is nothing complicated but a good organization of these components and the system is a headache. And the right decision will come only with experience
That is exactly right, I try to find the right balance between all these myself and it much depends really on the type of project you have. Right now I am implementing the shooting part and I am figuring out whether to create an entity, a component and a system for it or none at all
Please note: this is still WIP, my code may not please everybody , I tried to make it easy to "decrypt"
should be working: - jump run walk shoot - nmes platforms - animations
not implemented: - sounds - other type of nmes - the code can be simplified (merging the AIs) - no score, no player die - no optimisations - no delta time - no, no, no ...
Let's see how far I can take it, I will create a new thread to not spam rrraptor's mailbox
Comments
https://deluxepixel.com
Likes: MoKaLux
Edit: have some problems with native bump. I need custom response function for one-way platforms, and it looks like this:
Likes: antix, pie
Maybe @hgy29 can build this one into cBump
Likes: hgy29
See the commit
https://github.com/MultiPain/gideros-platformer/commit/bf41948f59196a8f5790614cbeb4d0342cee2511
or screenshot:
It doesn't work with native bump, for some reason. I removed custom response function, fixed "Item ray must be added to the world before getting its rect" error, and now player just crushing...
Btw, this example will not work with native verion, becouse of custom response function.
Likes: totebo
Likes: MoKaLux
I have two sample cases:
- bump.lua, when I am on a vertical moving platform I can jump when the platform is either going up or down which is super cool
- gideros cbump, when I am on a vertical moving platform I can only jump when the platform is going down
- bump.lua collisionfilter doesn't work as expected, that is the last elseif statement is always executed even if it doesn't collide at all
- gideros cbump collisionfilter works as expected
It is a shame because I would need a mix of bump.lua and cbump
I am investigating and trying to find where guderos cbump and bump.lua differ. I will also try to make a sample project to show exactly what I mean.
Here is my collisionfilter function (pass through platforms work out of the box without custom collisions)
bump.lua
Let me share with you a screenshot, github should follow soon God's willing
I will also post on itch.io to see how it behaves and hopefully have some of you guys feedback
Viva Gideros Studio c++ luau
PS: sorry I couldn't work on c++ Qt lately (I hate them )
Likes: E1e5en
Here I have divided each state into a separate system, the movement is also divided into systems for acceleration, braking and movement. I proceeded from the rule: divide everything. On using a separate system for the state, I read here: https://www.richardlord.net/blog/ecs/finite-state-machines-with-ash.html .
As a result, there are a lot of small pieces and it's probably better to combine some pieces anyway. Otherwise, it becomes difficult to control such a quantity.
- entities have unique id
- entities can have components
- systems act on components (thus entities)
Will try to post my take on ECS asap
I don't use state machine yet because it seems I don't need it so far and that would complicate my code?!
Therefore, it will be interesting to look at your solution. And the right decision will come only with experience, you need to practice using this template more.
Right now I am implementing the shooting part and I am figuring out whether to create an entity, a component and a system for it or none at all
GH https://github.com/mokalux/PLATFORMER_CBUMP_TECS_20221101_wodt
Please note: this is still WIP, my code may not please everybody , I tried to make it easy to "decrypt"
should be working:
- jump run walk shoot
- nmes platforms
- animations
not implemented:
- sounds
- other type of nmes
- the code can be simplified (merging the AIs)
- no score, no player die
- no optimisations
- no delta time
- no, no, no ...
Let's see how far I can take it, I will create a new thread to not spam rrraptor's mailbox
Likes: E1e5en
Likes: MoKaLux