[a / b / c / d / e / f / g / gif / h / hr / k / m / o / p / r / s / t / u / v / vg / vm / vmg / vr / vrpg / vst / w / wg] [i / ic] [r9k / s4s / vip / qa] [cm / hm / lgbt / y] [3 / aco / adv / an / bant / biz / cgl / ck / co / diy / fa / fit / gd / hc / his / int / jp / lit / mlp / mu / n / news / out / po / pol / pw / qst / sci / soc / sp / tg / toy / trv / tv / vp / vt / wsg / wsr / x / xs] [Settings] [Search] [Mobile] [Home]
Board
Settings Mobile Home
/g/ - Technology


Thread archived.
You cannot reply anymore.


[Advertise on 4chan]


Posting actual progress edition

gedg/ Wiki: wiki.installgentoo.com/wiki/Gedg
IRC: irc.rizon.net #/g/gedg
Progress Day: rentry.org/gedg-jams
/gedg/ Compendium: rentry.org/gedg
/agdg/: >>>/vg/agdg
Render bugs: renderdoc

Requesting Help
-Problem Description: Clearly explain the issue you're facing, providing context and relevant background information.
-Relevant Code or Content: If applicable, include relevant code, configuration, or content related to your question. Use code tags

Previous: >>102062659
>>
>>102100103
that's a man
>>
File: biblically accurate oop.png (176 KB, 1948x858)
176 KB
176 KB PNG
biblically
>>
>>102099991
What actually happens:
>a human is an object/entity that has a human mesh and some human behavior
>an animal is an object/entity that has an animal mesh and some animal behavior
>>
>>102100177
you're oversimplifying, it seems that your human behavior encapsulate all humans, npc and players, and the animal behavior is a gigantic switch case of all the different animal types.
actually, even in ECS, how do you handle different AI types? you can have a bunch of enemy types that act nothing like each other, does that mean you need a component per enemy type?
the AAA way is to have a scriptable component acting like a wild card, it's no different than a function pointer that can do literally anything. which doesn't use anything related to ECS.
>>
Maybe I'll do some todayposting today.
>>
>another whole thread where retards can't fathom using composition and inheritance in the same program
>>
>>102100407
You're only allowed to use one, don't mix the streams
>>
>>102100407
I don't even know what composition is and I'm not going to learn either
>>
>>102100407
we're purists here
>>
>>102100407
>using composition and inheritance in the same program
I-IMPOSSIBLE, MULTIPLE PARADIGMS A ONCE???
>>
>>102100440
there's a clue in the name
>>
Lads, I'm too close to the problem and need some outside perspectives.

TL;DR imagine a game where there's lots of npcs going to and fro over a large area.
(specifically, a naval game, with lots of ships.)

So, each one has a horizon they can't see beyond.
In that case, each ship needs to check the distance to each other, and make a list of "ships it can see".
Maybe to save on cpu usage, it could only check collision on others it can see, etc.

My question is what am I not thinking of in this scenario? What are some ways to save on cpu usage? How can such a system be lazy and not check everything against everything all the time?
>>
>>102101178
spatial partition
>>
>>102101186
I thought about something like that, but I didn't make much headway. I didn't know what the technique was called.
I'll do some research.
>>
>>102101186
Also, what do you call exceptions to that kind of thing?
I.e, say ship A is on the edge of a chunk of space such that it's horizon radious extends into the next chunk over?
Are there any good books about these kinds of problems?
>>
>>102101317
https://en.wikipedia.org/wiki/Spatial_database#Spatial_index
quadtree and octree are the most common for this purpose
they're hierarchical so if something is on the edge of two cells then it gets put in the next cell up the hierarchy
>>
>>102101328
Ohhh, I get the basic idea.
Thanks man, I was metaphorically beating my head against the wall thinking about this.
>>
>>102101272
>>102101317
You can use partitions of any complexity you like. The simplest would probably be a uniform grid and the collision checks you would make in that case would be the 9 grid squares surrounding the object including the one it is in
>>
>>102101363
I can dig it.
>>
ded
>>
What has gedg become?
>>
any chill dudes here that want to tinker with gzdoom with me? im trying to scrub it out and embed python to be the scripting language since 3.13 will have JIT compiling.
>>
>>102103793
I made a Doom map and did some simple scripting once, it was pretty fun
>>
i'll start today i swear
>>
>>102100103
I would like to apologize for the state of /gedg/ for the past week.
I was the original anon who made a thread about the troon in OP picrel https://desuarchive.org/g/thread/102022335/#102022335. It randomly showed in my feed and I decided to make a thread about it. Now a certain retard, who autisticly combed thought its IG and whatever, now non stop shills this troon. So I am sorry for the anons behavior, hopefully he gets bored and finds another troon to coom too (hey that rhymes) without posting it's face on /g/ all day of course.
>>
>>102104202
nobody cares, just ignore it
>>
https://hackernoon.com/pico-8-lighting-part-1-thin-dark-line-8ea15d21fed7
>>
File: rust.png (25 KB, 841x299)
25 KB
25 KB PNG
>>102100169
-ACK
>>
File: 1722512052196707.jpg (220 KB, 1287x821)
220 KB
220 KB JPG
>>102104202
eventually the luna spammer in /agdg/ got tired so hopefully the same happens here.
>>
>>102104202
seethe and cope, you will see it every day until (You) like it
So until you post actual progress, our queen will be here to save the thread.
the past thread was nothing but ECS garbage and chuds seething about a picture.
>>
>our
>queen
>she
>>
>>102104834
I don't get tranny languages
>>
File: 1696116183889646.png (29 KB, 500x400)
29 KB
29 KB PNG
>>102100103
for those who went through the hell of graphics APIs can you guys link me a good introduction material that explains the basic concepts that all graphics APIs share at an abstract level?
>>
>>102104984
just learn one
>>
>>102104984
opengl is abandoned
directx is windows only
metal is apple only
vulkan runs everywhere outside playstation
pick where you want to see your cube tutorial running
>>
How do ya call a design document/documentation for a game and what are the standards for that? I am a CGI guy with basically no coding background, but I want to pitch a project to my IT friends.
>>
>>102104984
https://floooh.github.io/2016/10/24/altai.html
https://wickedengine.net/2021/05/graphics-api-abstraction/
>>
Why do so many people know exactly what is and isnt (OOP|encapsulation|inheritance|an entity component system|composition)?
Is there some special class in university that teaches all the jargon? It seems so pointless to stick a label on functional code and then get upset that someone else has stuck a different label.
Can someone elaborate on what the point of the discussion is?

Me, I use structs and if something wants to use something else I put that struct inside the outer struct. For example my player struct has a camera struct inside it.
I have no idea what this is called but it works well.
I'll let you know if I run into some unfixable code.
>>
>>102105145
OOP is not clearly defined
The rest of those terms are
>>
>>102105145
oop means you make structs with the keyword 'class' and this struct can be 'inherited' from another one this means the fields and methods 'encapsulated' in the 'parent' class are available in the 'child' class
composition is the thing you did with the player/camera structs
ecs means instead of having values inside a struct you have an array for each kind of 'component', and you access those values by an entity index
so you have an hp_array[], position_array[], etc and you get your player hp by doing hp_array[player_index]
'system' are the loops in your engine processing data for the 'entitites' like running collision checks or physics on all entities
the idea is processing things in arrays is faster because of cache but programming this way is a pain in the ass and is only useful in games with 10000 units in the map at the same time
>>
>>102105145
>special class in university
Any competent course about programming will teach what OOP, the most popular programming paradigm ever, is about.
>>
>>102105357
Thanks.
It seems to me that this (ecs vs normal structs) is pretty similar to the 'struct of arrays' vs 'array of structs' difference. Is that basically it? looping over an array is faster than indexing structs because the memory is contiguous. Or are there more supposed speed benefits I'm not realizing?
>>
File: output.webm (2.07 MB, 1280x720)
2.07 MB
2.07 MB WEBM
Why you bicker over ECS or OOP, here's some progress.
>>
>>102105977
good progress. i think it would look a bit better of hovering is also contained by the grid, the free overlap looks weird.
>>
>>102106461
thanks for the feedback. I disagree because the free overlap is an additional indicator that you can' t place the object. Not that I care that much about accessibility, but using only color is not a great indicator.
>>
>>102105357
Point of ECS is to move a lot of decisions about game objects out of code. You don't inherit "class Cat" from "class Pet", you just declare an entity with components that gives it cat model, animations and behavior. And you can implement OOP on top of ECS purely in data. Performance is just a nice implementation bonus.
What you describe is data-oriented design.
>>
>>102106699
What you're describing is called composition and it has nothing to do with ECS
>>
>>102106721
ECS is a form of composition.
>>
>>102106734
ECS is an architecture that uses composition
>>
ECS good OOP bad
>>
Rust good C++ bad
Vulkan good OpenGL bad
>>
If ECS is so good then how come nobody can easily explain what it is without invoking other unrelated concepts that are common features of most programs that are not ECS? I think when people say OOP they can at least reduce it to some core features of the language such as polymorphism, encapsulation, data abstraction and inheritance. You learn what those things are and then you know OOP. It sounds more like ECS is about what something is not, rather than what it actually is, like you are taking away the ability to do things and that restriction is somehow gooder because it has a trendy name attached to it. Extremely cargo cult like.
>>
File: 1724332816111575.png (1.04 MB, 1184x1200)
1.04 MB
1.04 MB PNG
>>102107014
This is the tranniest of take imaginable. gj dude
>>
>>102107040
I good You bad
>>
>>102107037
I can explain what ECS is but you can easily Google it so why would I bother
>>
>>102107037
It's a database that represents game's state. Components are tables and systems are queries.
>>
>>102107083
then systems are rows?
>>
>>102107083
almost there but you're missing the systems part
>>
>>102107083
You can't just take a concept that already has a name and call it something else to sound trendy.
>>
>>102107131
It's the best way to think about ECS, as some sort of specialized database. At least for me. I've shipped a game on ECS few years ago. Works fine.
>>
>>102100169
Please make a version of this for ECS
>>
>>102107050
>I man You tranny
FTFY
>>
>>102105145
The original c2 wiki had a lot of useful design patterns documented. Still a nice read to this day.
>>
>>102107201
Buzzword because you don't have a response. I accept your concession
>>
>>102107255
>Buzz
like the stubble on your chin. don't forget to shave or you might not pass.
>>
>>102107268
you're projecting so hard, I can see it through the screen
>>
>>102107317
How do you feel when you see your reflection in the screen? Does that trigger you?
>>
>>102107339
It doesn't unlike you of course
>>
File: 1724705173572543.jpg (221 KB, 797x793)
221 KB
221 KB JPG
>>102107359
>tranny coping hard
gottem
>>
>>102107383
>rent free
I wonder why's that.
>>
File: 1724353440217720.png (328 KB, 2158x1713)
328 KB
328 KB PNG
>>102107423
lol still seething
tranny can't give up. if only you lasted this long in life.
>>
Fucking finally.
https://monogame.net/blog/2024-08-16-monogame-382/
>>
>just want to talk about making videogame engines
>thread gets filled with people obsessed about talking about trannys instead
I miss the old 4chan.
>>
>>102107498
>no primitives
Duh...
>>
Quick question. Should I bother learning opengl? Or should I go straight to vulkan? I heard that there isn't much documentation for vulkan compared to opengl.
>>
>>102105145
>I have no idea what this is called
it's called spaghetti
>>
>>102107531
the last threads were full of shitposting, if you rely on actual progress posting the thread would die before reaching half the bump limit.
>>
>>102107862
Let's hear your suggestion to have the camera move when the player moves.
>>
>>102107746
Vulkan has plenty of docs and tutorials about, but it requires more setup. It’s probably more future proof though.
>>
>>102108179
>It’s probably more future proof though.
Yeah, because it seems like companies like nvidia are ending support for opengl.
>>
>>102108020
camera.attach_to(player_entity);
>>
>>102108020
camera.set_position(player_transform.get_position());
>>
>>102108411
Seems a lot more complicated to implement.
>>102108427
I'm doing this already. The camera is just inside the player struct.
>>
File: 1724155970355096.gif (1.98 MB, 370x256)
1.98 MB
1.98 MB GIF
>>102108635
No I want to kiss you
>>
>>102108451
>Seems a lot more complicated to implement.
"attach_to" is literally
camera.target_entity = player_entity

and in update
camera.position = entity.get_position();

you can animate attaching and detaching to different entities.
cameras are different from other "entities", normally there's only one (or several, but only one active, unless you're doing split screen old school style). you want to animate the shit out of cameras, so you need to think ahead for it.
>>
>>102108825
I like that, thanks.
>>
>>102107199
That would require that ECS detractors actually understand how it works
>>
>>102110875
That would require that ECS fanboys actually make games.
>>
What game engine/framework should I use to build a platformer like Celeste?
>>
>>102111308
HRT
>>
>>102111308
literally anything. the devs themselves published the player controller code
https://github.com/NoelFB/Celeste/blob/master/Source/Player/Player.cs
not that it matters since you can disassemble the whole game anyway.
>>
>>102111308
Scratch
>>
File: progress_cf.png (400 KB, 1306x1287)
400 KB
400 KB PNG
Flooring and ceiling works. Tools work. I've spent some time doing occlusion and visibility but my first attempt was way too slow.
>>
>ECS is better than OOP
>Not a single programming language with builtin Entity and Component
Really makes you think don't it?
>>
>>102111538
what are you planing to do with the floor and ceiling?
>>
>>102111861
The ceiling slices bricks above it for a better view of what is getting built - layer by layer.
Floor is a collision plane, otherwise it gets hard to place bricks in arbitrary positions.
>>
>>102111901
Oh ok I get it. it's purely for the editor. I would have gone with a layer that does both at the same time. but your way have more control which is good.
good job on the editor.
>>
Anybody else tried to experiment making a rule based engine?
They tend to be super useful for board games, and turn based games by extension. I had fun porting parts of ttrpg ruleset (GURPS) to a discord server, but I've never went further.
The best thing about it is that the rules themselves are asserts, so the state of the board/systems will always be valid, add a feature to save and copy a board and now you can run a min-max AI algorithm on it. The same thing can't be said about typical game implementations.
>>
Godot even runs on my toaster, so I'll not be drawing triangles anymore. I'll be shipping real games. Later friends.
>>
File: yandere_dev.png (17 KB, 753x159)
17 KB
17 KB PNG
>>102111372
huh?
>>
>>102111318
whats that?
>>
anyone programmed a game and sold it on steam?
>>
>>102113215
i saw some /agdg/ game released recently on /v/ the other day.
>>
Any Rust users here? What's the performance disparity like between arc and rc?
>>
>learn gl
>create nice reusable classes
>start making game
>"use a static resource manager and sprite renderer"
>>
>>102113215
No but I looked at what you need to get "steam approved" and the only takeaway was 12 px font size min
>>
>>102100103
that's a man
>>
>>102115568
arent we all?
>>
>>102116033
No
>>
>>102116168
that's one though >>102100103
>>
>>102116168
Post feathers
>>
>>102112422
I don't dislike it. It's got a lot of useful features, and the editor is nice.
>>
>>102112422
>Godot
>I'll be shipping real games.
not likely lmao
more enginedev games have been successful than godot devs
enginedev games there are like minecraft, starsector, stardew valley, dwarf fortress, factorio

godot there's uh

uh

...

godotsisters?
>>
>>102117141
There's a comprehensive of all games made with godot
https://godotengine.org/showcase/
Where's your engine's showcase?
>>
>>102117160
>https://godotengine.org/showcase/
I don't recognize any of those could you post the successful ones instead
>>
>>102117267
dome keeper
halls of torment
schizo squad
brotato
>erm actually it needs to gross 250 billion dollars to be "successful"
Post your 15 yachts purchased from the sales of your game or cease posting
>>
Your game will never be good, nobody will play it, give up now!
>>
>>102117299
>a tower defense roguelike, two Vampire Survivors clones and a game only notable for how ugly it is
so this is the power of Godot?
>>
>>102117478
Versus anon's engine that struggles to output a single rgb triangle. Assuming he even managed to follow the first basic tutorial (you didn't clearly as you have nothing).
>>
>>102100142
Learn a new joke someday.
>>
>>102117522
Why don't you use a real engine then? Oh yeah, toaster, never mind
>>
>>102117534
>joke
>>
I want to make a DMC/Nier-esque game in Unity from 0 experience with it.
The last game I made was Space Invaders 11 years ago in C# for a uni course.
Should I just watch tutorials on the basics of Unity and a specific ones for relevant game mechanics to get started?

I have little graphic/animation experience (I made an animation in Maya for uni, but that was just a tank rolling around knocking down trees and turning its turret), so I'm fine with just using free assets. I figure there's point worrying about how pretty the game is until I can prove that I can make it.
>>
>>102117618
you're overqualified
>>
>>102117618
A DMC/Nier-esque game is all graphics and animation, it'd be hard to make one yourself
>>
>>102117747
I was thinking I'd start small with the attacks.
Just a light attack chain and a heavy attack for breaking blocks. The character would need basic movement and a few dodge animations.
I imagine the difficulty is linking them together smoothly, especially moving while attacking.

I wouldn't approach the complexity of DMC, but Nier was far more braindead than I had anticipated, so that should be achievable.
>>
>>102117747
real nier is just schizo writing, autotomato (trash) is worthless graphics
>>
File: 1696216403983.jpg (41 KB, 487x650)
41 KB
41 KB JPG
I want to make a roguelike that takes place in the basement of a castle, and you're a knight, and go around procedurally generated rooms and kill stuff and open chests that give you loot.
>>
>>102118182
>roguelike
stopped reading there
>>
Starve the bait posts. WAGMI
>>
File: teapot_tex.webm (737 KB, 564x445)
737 KB
737 KB WEBM
It's absolutely shameful how long it took me to render a texture. Feels good to finally get something drawn to the screen after wallowing in the mire of segfaults for so long.
Many happy renders to you.
>>
QRD on Catsoft's game creator?
>>
>>102117534
>joke
that's just fact
>>
File: Untitled.png (89 KB, 1895x1005)
89 KB
89 KB PNG
my shadows r autistic :^(
>>
Do people still count flops to estimate performance?
I can currently check whether a capsule and a triangle collide in at most 3 divisions, 92 multiplications, 58 subtractions, 51 additions, and 34 comparisons (assuming I counted correctly).
If a modern cpu has a couple hundred Gflops, I can (without any culling or other tricks) calculate collisions with (on the order of) 1billion triangles each second.
Does that seem right? I have no formal training in CS so don't know if this is really how it works.
>>
File: output.webm (1.24 MB, 1280x720)
1.24 MB
1.24 MB WEBM
It's now possible to place windows with the object tool.
Looking at the webm I'm not 100% satisfied with how I rotate objects.
>>
>>102121805
Dragging to rotate seems more effort (for the player) than a keybind which rotates 90 degrees.
>>
>>102121805
Why not snap rotate like in sims? You're never going to place a window perpendicular to the wall
>>
>>102121850
The idea behind dragging to rotate is that as you're placing the object might as well let you rotate it by dragging the mouse around. But what I find is that's awkward if you just want to rotate the object before placing it somewhere else.
I see that in the sims 3 they both do dragging rotate and some keybinding to rotate the objects. So I'll try that.

>>102121867
snap rotate for the windows is coming next.
>>
>>102121867
It might not be the case currently but perhaps some windows in the future will have different front/backs
>>
Couldn't fully implement multi-threaded loading so only decompression/import lives there now. Resource creation and uploading is for main thread only for now. Currently implementing something similar to simplified XNA Effects, a set of passes with their own shaders and pipeline states. Like if effect has "shadow" pass then I can draw it into shadow maps, "main" then in color buffer and so on. Just don't want to deal with this stuff in code and I can compile all possible pipelines upfront.
>>
>>102107746
Dunno.
Vulkan tutorial is very cool and Vulkan Samples repo by Khronos group is an awesome example codebase.
Opengl is still cool because it opens the door to webgl. The shaders will be mostly interchangeable.
WebGL is certainly easier.
>>
>>102105062
>vulkan runs everywhere outside playstation
and apple
>>
>>102106826
tfw using ECS for game objects and OOP for my UI library
>>
I realized I don't actually enjoy making games or playing them.
But I do want to know how graphics works.
>>
File: Class Hierarchy.png (37 KB, 865x902)
37 KB
37 KB PNG
refactoring to fit this
>>
thread is full of demoralization shills or incompetence

keep going
>>
>>102118779
gj is it with vulkan or opengl?
>>
>>102119360
>cascaded shadow maps
cool voxel engine.
>>
Enginebros...
It's so over...
https://arxiv.org/pdf/2408.14837
>>
>>102120874
You can get a generic ballpark number that way but remember if your process gets rescheduled by the kernel at any point that’s gonna cut into your figures, especially on lower end systems where you only have 1 or 2 cores.
Also the other thing more important thing you need to factor in is the memory cache. If your algorithm isn’t cache friendly it doesn’t matter how many flops your cpu can theoretically handle if it’s bottlenecked by slow copies to and from system ram.
>>
>>102125707
>20fps doom
oh shit it's so over!
>>
>>102118779
segfaults don't exist if you have address sanitizer.
but you are probably just saying segfault as a habit.
>>
>>102120874
benchmark code by measuring with a timer don't try to guess based on theory
>>
>>102125707
>players can't backtrack because AI only simulates forward and never remember what's already seen
lmao
>>
>>102101178
This is identical to the collision detection problem, particularly the broadphase because the narrowphase in your case is just a trivial circle vs point test. So you need a spatial and/or object partition structure. I think the heavy overlaps in your case make object partitioning better. This goes by several names like
>bounding volume hierarchy
>AABB tree
>>
>>102100103
that's a man btw
>>
>>102129513
and?
>>
>>102129963
and what?
>>
>>102130088
what's the followup?
>>
File: output.webm (2.24 MB, 1280x720)
2.24 MB
2.24 MB WEBM
Window snapping to wall
>>
>>102130100
What follow up? I'm just informing the thread that the man in the OP pretending to be a woman is in fact a man pretending to be a woman. There's no joke, no punchline
>>
>>102130335
It was already mentioned. Why would you chime in, yet again, with nothing of value to say? What else do you want to add?
>>
>>102129238
Yea, after taking a step back and considering it like that, It's not as complicated as it seemed at first.
>>
>>102130356
Nothing else. Just that it's a man
>>
>>102130475
I suppose your obsession with fact means you have a crush on him.
>>
>>102130497
You're getting very defensive considering I'm simply stating a fact
>>
>>102130543
Stating it numerous times when no one asked. I get it. You love your boyfriend but please keep it to yourself.
>>
>>102100103
that's a man
>>
>>102117299
>random shit nobody's ever heard of
I'll accept that as your concession.
>>
>>102104834
> common components are frequently used.
> the correct solution is a 6-classes-deep hierarchy where Path inherits from SegmentedSpanTokens
>>
>>102112653
Have you made a platformer before? Movement is complicated.
I had a movement script that was 2500 lines, so I did a huge rewrite focused on removing duplication and simplifying things, and the result was 2200 lines.
>>
>>102131344
how is platformer movement complicated?
>>
>>102131344
>movement script
>2500 lines
W-what all is that script doing?
>>
>>102131364
> You press jump.
> You don't jump, because you pressed jump five milliseconds after you left the ground.
> It feels like shit.
> Implement coyote time to fix it.
> You press jump.
> You don't jump, because you pressed jump five milliseconds BEFORE you touched the ground.
> It feels like shit.
> Implement input buffering to fix it.
> You press jump and left.
> You don't jump to the left, because you started holding left five milliseconds after you pressed jump, and your acceleration is slower in the air.
> It feels like shit.
> Implement a "jump" state between the "ground" and "air" state to make sure "press jump and left" feels the same as "press left and jump"
> You press jump and left.
> You run into a sloped ceiling and get shot down at 500 miles per hour.
> It feels like shit.
> Implement a collision algorithm that doesn't shoot you down at 500 miles per hour when you hit a sloped ceiling.
> You press jump.
> You don't jump, because you're on a platform moving up faster than your jump velocity.
> It feels like shit.
> Track the velocity of the object you're standing on and add it to your velocity when you leave the ground.
> You press jump.
> You don't jump, because you're standing in V-shaped geometry that's considered too steep to stand on.
> It feels like shit.
> Track every collision over multiple frames to detect V-shaped geometry and treat it as level ground to fix it.
Repeat for every action in the game.
>>
>>102131649
That stuff is about as simple to implement as it is to describe
>>
>>102131649
>zoomers need a bunch of fudging mechanisms because they can't hit the jump button at the right time
>>
>>102131667
One complicated thing is 100 simple things.
>>102131701
Your game being shit isn't my problem. Steam has a refund policy.
>>
>>102131802
Yeah you should implement a "win game" button too because losing feels like shit
What a cucked game design mentality, removing what little challenge platformers already have
>>
>>102131667
Simple doesn't mean concise
>>
>>102131823
My code for handling those cases might be only twice as long as the post describing them
>>
>>102131859
Okay post it and let's see if it does everything the other example has
>>
>>102131822
You don't even have a game and you're already seething about how much work it takes.
>>
>>102131893
I've released 2 platformers
>>
>>102131914
Hmm, strange. You haven't posted anything.
>>
>>102131936
why would i
>>
>>102131914
You made an entire video game and somehow think anything I listed is equal to a "win the game button"?
I didn't add those to my game because somebody complained. I added them because real people aren't capsules/cylinders/rectangles sliding around, and throwing that to the default physics system makes a game that feels like janky shit.
I don't read the game state, I see it with my eyes, so when my eyes see I'm on the ground, I want the game to see it too.
>>
>>102132045
Your character isn't visibly on the ground before he lands
Coyote time is somewhat forgivable
>>
>>102132068
5 pixels can be hard to judge on a moving character if your ground isn't a perfectly flat, featureless plane.
>>
>>102132096
your character is on the ground when he stops moving downwards
>>
>>102132133
Which can be hard to judge on a moving character if your ground isn't a perfectly flat, featureless plane.
>>
>>102132138
you can judge when your character is moving down based on it visibly moving down on the screen and playing the falling animation
>>
>>102132146
And them you press jump right as you perceive your character to touch the ground. It doesn't jump. This feels bad to play.
>>
>>102132190
you mean you press jump before you percieve your character hitting the ground
whereas actually you should be pressing it after you percieve your character hitting the ground
>>
>>102132207
No, as you perceive your character hitting the ground. But it's a couple pixels off the ground.
>>
>>102132238
then you didn't percieve your character hitting the ground
>>
>>102132251
But you did. It looked as though you landed.
>>
>>102132269
Your character lands when it stops moving downwards
>>
>>102132238
Why is the visible character sprite not synched with the internal representation of what's going on to begin with?
>>
>>102132279
It looked like it landed. So you pressed the jump button.

>>102132283
It is. But it was close enough to the ground it looked like it landed to you.

At this point you are either retarded, a bot, or only play games at 120x120 resolution.
>>
>>102132068
I tend to make 3D platformers, where the distances can be miniscule.
If you have big chunky pixels that tell you exactly where the character is, I can forgive not having input buffering.
Even then, having a single frame be the difference between missing your jump and doing it perfectly is arbitrary.
If the player can't see why they fucked up, because it was too small of a distance or happened too quickly, they'll just think the game is buggy. It doesn't matter if the game was perfectly consistent with the rules you decided, because they don't play the game by reading the code and saying "ah, I will jump on the first frame that my Y velocity is zero".
I've seen people on here bitch that Celeste is bad game design because it's too hard for them, and that has everything I listed.
I lost the MS Paint "make some jumps and then put pixel-perfect spikes everywhere" meme that people post all the time, but I'm sure you've seen it.
>>
>>102132300
>It looked like it landed.
Then your perception was at fault
>>
>>102132311
Not everyone plays games with only 400 pixels total zoomed in 400% like you grandpa
>>
>>102132306
Pandering to people's incorrect perceptions is morally bankrupt
>>
>>102132324
You're calling me a grandpa but your eyesight is so bad you can't even see the character you're controlling?
>>
>>102117534
>joke
My man, in 90% of cases it's not a joke.
>>
>>102132348
I must assume you only play games that use cubes for the ground and never have like a single blade of grass or any decoration at all. Pathetic, sad.
>>
>>102132370
I've played all sorts of games, I'm guessing you haven't because you sound pretty bad at them
>>
>>102132376
Playing your one singular prototype one hundred times is not "playing all sorts of games"
>>
>>102132390
There's lots of games that require to actually be on the ground when you press jump, including popular 3D platformers
>>
>>102132335
The player collider touching the ground collider is not a moral debate. I don't give a shit as a player or as a developer.
In real life, a person would just extend their toes further if they wanted to jump slightly earlier. They aren't a cube that has to make full contact with the ground before they can jump again.
>>
>>102132461
It's clear when the player lands on the ground
It's not as clear when they leave the ground from walking off a cliff, but still pretty clear with practice
>>
File: 1723407703466315.gif (27 KB, 775x849)
27 KB
27 KB GIF
How hard is it to make a game in Unreal 4? I can't even manage to make chess, the fucking C++ class isn't turning into a mesh
The pawn isn't moving correctly either
Is it over?
>>
>>102132638
coal post
coal dev
>>
I wanna get into Unity for 3D games. What are some tutorials for silky smooth movement?
I'm talking smooth accelerations from stationary, to walking, to sprinting, then skidding a little bit when going from a sprint to a stop.
Once I've got that down, I wanna adapt it for slopes and other irregular terrain.
>>
File: sddefault (1).jpg (38 KB, 640x480)
38 KB
38 KB JPG
>>102132652
AAAHHHH WHY CAN'T I USE CHATBBC!!!
>>
>>102132658
try maths
>>
File: 1723152624986198.gif (692 KB, 600x338)
692 KB
692 KB GIF
>>102133144
>>
>>102133150
if an hero is more appealing than maths, gamedev aint for you
>>
>>102105063
"Game design document" is used since always.
>>
>>102133178
I was just bantering about the lad obsessed with "smooth acceleration"
Kek
>>
>>102132658
>What are some tutorials for silky smooth movement?
use Time.deltaTime
>>
>>102105063
>What are the standarts for that

There is currently no standardization in how you should write design documents, but a book named "Level Up! The Guide to Great Video Game Design" maaaay help you with it
>>
File: 1688063547217683.jpg (332 KB, 3000x2279)
332 KB
332 KB JPG
Umm ... guys?

https://rust-gpu.github.io/
>>
File: 1722006237533803.jpg (29 KB, 520x476)
29 KB
29 KB JPG
>>102118182
Make a roguehate instead.
>>
>>102133660
rust is actually a shittier language than glsl/c
>>
>>102124174
Best way to go.
>>
File: ammoclass-export.png (91 KB, 1486x521)
91 KB
91 KB PNG
I made an ammo class for the ship ammo
>>
>>102133660
languagrue war oosts dont belong in a gamer dev thread
>>
>>102133660
lmao
>>
Should I take the Skullgirlspill and then my fighting game into a Coomer incel marketing scheme?
>>
>>102133178
>>102133150 is not me.

I'm guessing I just need a skid animation for each direction which would be triggered when the movement key/stick is let go.
>>
>>102134102
You ARE a troonjak making a tranny game though
>>
>>102134254
Are you like this because you're on 4chan or are you on 4chan because you're like this?
>>
>>102134594
Just make the game tranny
>>
>>102131344
>Have you made a platformer before?
i did, the movement itself can't exceed a quarter of that file size. it's just that in Celeste it has the full animation statemachine including cutscenes, and the hair is a trail of particles, then there's duplicated code for a bunch of situations and special cases.
the code certainly can be "compressed" further, not for the sake of optimisations (it's just a bunch of if statements so who care), but for the sake of the programmer's sanity. imagine having to parse the full thing to add some new feature or modify something.
that being said, Celeste is just a Mario style platformer with wall climbing, if it was as complex as Sonic platforming I wouldn't look twice at the number of lines.
>>
>>102131701
Most of those mechanics exist since Mario on NES.
>>
>>102135608
nah they're more recent than that
>>
>>102135621
Last time I implemented platforming about 15 years ago, and those mechanics were old common sense back then already. I can say that at least "coyote time" existed back when Crash Bandicoot was in development. It's impossible to make platforming that feels good without those things. Player's perception is everything.
>>
>>102135818
NES is 40 years old not 15 years old
Crash Bandicoot didn't have coyote time, none of the platformers from the golden age of platforming did
>>
>>102136075
I remember interview with one of developers. They shown their game on what soon became E3. One of those then-famous Japanese developers checked their game. And he checked exactly how coyote time was implemented and he liked it. If you can't see mechanics then it doesn't mean it isn't here. It's impossible to make game that feels good to play without it.
>>
>>102136139
>It's impossible to make game that feels good to play without it.
Yet all the most famous platformers don't have it
Puzzling
>>
>>102136158
They have. Otherwise player wouldn't like them because playing would be too frustrating to enjoy. That's the point.
>>
>>102136204
Go play any SNES game or PC game from the 90s, it's not there
>>
>>102136211
Donkey Kong? Or was that not a good platformer?
>>
>>102136249
havent played it
>>
>>102136075
>coyote time
why the fuck are you arguing about what's literally a fucking counter since last the player hit the ground in addition to the already existing check of the "is_on_the_ground"?????
it's fucking 3 lines of code max, why are you people even mentioning it?
>>
>>102136393
cause people said if you dont do these things your game is unplayable which is hilariously wrong
>>
>>102131296
>I'll say 6-classes-deep because that makes my (imaginary) defense more desirable.
>Thank me later for this unmaintainable lasagna.
>>
>>102136410
>https://youtu.be/OfSpBoA6TWw?t=1032
depends on the level designer imo, if he's an asshole who adds platforms that are just high/far enough that the game is straight up bullshit without QoL, then it's the designer's fault more than the programmer's.
>>
>>102136560
>guy jumps a full meter before the edge of the platform
>dies
>"that was unfair"
do you seriously believe this?
>>
>>102136560
A game cheating for you to make you feel like you are better player than you are is not the bar for playability, it's about target audience and games like that target washed up boomers, nothing wrong with that
>>
>>102136663
Washed up boomers grew up with arcades and limited continues.
>>
>>102133630
thanks, I will look into it
>>
>>102136686
The epilogue of the video he says to make games as you remember them, not as they actually were
>>
>>102136709
Therefore the target audience are zoomers who believe they are playing boomer games.
>>
File: output.webm (750 KB, 1280x720)
750 KB
750 KB WEBM
/gedg/ discussing gamedev? have a poutine
>>
>DOOM gets AI generated instead of rendered
>seems still playable
https://www.youtube.com/watch?v=jHS1RJREG2Q
>>
>>102138092
>still playable
>walk down hallway
>turn around
>teleported into another dimension
>>
>>102100103
bro that's a man
>>
>>102138092
>need a gaytracing gpu just because python devs got filtered with BSP
>still runs at less than 30 fps
>>
Could a classic ascii roguelike work? Like those MUDs but specifically a roguelike?

I'm thinking you make a new character, enter the dungeon, and then the server either generates a new floor for you to explore or connects you to a floor that is already being explored by another player.
To prevent griefing maybe you would need a new staircase so they can't camp there, but otherwise it sounds kinda fun no?
>>
>>102139747
No just give up you cannot mix ascii and a rouglike together
>>
>>102139747
do you browse /rlg/ huh huh huh HUH?
this is literally my idea backlog
I think it could work
>>102139848
nice bait yeoman
>>
>>102139868
No bait just answering his retarded question
>>
>>102139874
you cannot possibly be this retarded
>>
>>102139909
I know right? Imagine asking something that stupid.
>Could a classic ascii roguelike work?
Like seriously guy must be braindead.
>>
>>102139868
rlg?
huh?

if you have that idea lets make it happen
i can make the logo
>>
>>102117747
pretty much. I've got my hands on a ripped 2B model and the animations on that fucker are crazy
>>
>>102118779
I HATE ALIASING I HATE ALIASING I HATE ALIASING I HATE ALIASING I HATE ALIASING I HATE ALIASING I HATE ALIASING I HATE ALIASING I HATE ALIASING I HATE ALIASING I HATE ALIASING I HATE ALIASING I HATE ALIASING
>>
>>102124953
You don't need to make diagrams and shit anon. Just write the code and refactor as you go
>>
>>102130250
I like your crib anon.
>>
>>102140295
>NOOOOOOOOO YOU HAVE TO SMEAR THE SCREEN IN BLURRY SHIT
Low IQ NPC detected
>>
>>102106582
it would look more obvious and feel more comfy if a grid pops up on the ground while moving or rotating the table around.
>>
>>102140362
how is multisampling blurry nigger?
>>
>>102140376
Oh ok it was a comment about the lack of grid. In that case I misunderstood and I agree.
I currently show a grid on the grass tiles but I need to rework this system to show the grid on all tiles when you're placing walls, tiles and objects.
>>
>>102100142
not in this case
>>
>>102107092
No, entities are row. Systems are like queries/transactions
>>
>>102141119
so components are rows?
>>
>>102141143
>>No, entities are row
>so components are rows?
baka

but nvm, Ill try to explain pure ECS with the database analogy.

You have a main table, called entities. It contains just one column, the ID, which is a primary key.

Then you have other tables, like VelocityComponent, TransformComponent, SoundComponent etc.
Each of these tables contains the respective information as columns for the component + a foreign key to the entity they belong to.

What a system does, is essentially performs a join over the tables of the components it needs, so for example if you had an UpdatePosition system, it would do a join over the VelocityComponent and TransformComponent, and would update the position of each entity (stored in the transform) with the velocity.
>>
File: cubes.webm (2.91 MB, 1600x900)
2.91 MB
2.91 MB WEBM
125000 cubes without with simple culling and without instancing. The bottleneck here is the CPU.
>>
>>102141969
>his engine can only do 125,000 cubes
>>
File: cubes2.webm (3.59 MB, 1600x900)
3.59 MB
3.59 MB WEBM
>>102142327
1,000,000 cubes with instancing. Now the bottleneck is my IGPU.
>>
File: nullcull.png (20 KB, 826x96)
20 KB
20 KB PNG
>>102141969
Did similar test for my engine, moved from 40ms to 17 just by preallocating big enough arrays for culling and for render ops. Because realloations eat far too much CPU. Actually submiting 125000 draw calls is less than 3ms, so there's no point in instancing. It's possible to multithread slow parts. But it isn't that important really, I won't draw more than few thousands objects at once anyway. It's better to go for good culling.
>>
>>102143646
what tool do you use to get a graph like this
>>
>>102143753
It's puffin and puffin_view. Rust has some nice toys.
>>
>>102104202
I also got that video recommended to me. I have noticed that youtube recommends tranny channels to people even if the channels are very small.
>>
>>102143646
>Actually submiting 125000 draw calls is less than 3ms, so there's no point in instancing
that greatly varies depending on the gpu. Try it with a 10 year old gpu and also igpu
>>
>>102144438
Sounds about the same as benchmarks I ran 10 years ago
>>
>>102105062
Not an engine dev at all, but this is misinformation.
First of all, DX11 will run better on Linux via Proton that a native Vulkan game will.
Especially since with DX11 you get a fuckload of optimizations made by experienced engineers. With Vulkan and DX12 you're on your own. As a beginner, you won't get the performance that DX11 gives you, and everything will be twice as hard, especially since being a beginner you don't know what the fuck you're doing.

Eventually you'll implement an RHI and the API won't be as important.
DX11 is the best API for any beginner.
>>
>>102144893
If you aren't an engine dev how do you know what's easy to use?
>>
>>102144915
I'm not an engine dev because I want to make a game, not because I'm not somewhat familiar with graphics APIs
>>
>>102144939
If you've made a game with a graphics API I think you're allowed to call yourself an engine dev
>>
>>102144950
My experience with graphic APIs amounts to drawing a bunch of triangles on the screen and loading some textured teapots.
Doing that taught me a few things
>I do not want to make engines
>DX12 and Vulkan are not made for beginners (hell, they aren't even made for the average experienced developed either, but I learned that a different way)
>a mature engine will end up supporting multiple APIs, the API you choose is less important than you think
>Proton is great

That means, pick either an older DX (11 is perfect) or OpenGL. Less headaches, better performance. If you make a hit game (or a hit engine), you'll add Vulkan support eventually if that's what you want.
>>
>>102100103
Anyone got some resources on Source game multiplayer bots? There is this game Neotokyo on Steam and i can never find a lobby, it doesnt have bots for some reason (probably nonstandard gameplay), but i want to try to make some bots for it.
>>
,
>>
>>102100103
that's a man
>>
>>102147747
arent we all?
>>
>>102147814
I don't know. I can only speak for the man in the OP and myself
>>
>>102145058
Not exactly what you're after, but there was a bot for old Day of Defeat 1.3b called Sturmbot.
It was the best Half Life mod bot at the time.
If you can track it down, it might be of value for study. It could learn n sheeit.
>>
>>102144438
Submitting draw calls is CPU job and I can do it in multple threads if needed. 10 years old GPU might not support vulkan. Executing them is different thing. My main goal is to work on iGPU, so I can't do anything fancy.
>>
>>102143646
it's funny when people seethe about something having 1k draw calls and that it's "draw call spamming" no nigga it literally does not matter
>>
File: 2024-08-29 23-05-25.webm (2.86 MB, 1280x720)
2.86 MB
2.86 MB WEBM
Did more work on the engine, I feel like I see that light at the end of the tunnel now.

>>102106699
>OOP on top of ECS purely in data
?
First up, no one is making a Cat class or a Pet class, this is just an anti-OOP straw man. Next up, and ill keep saying it: handles are awesome,handles are why people like ECS, handles are not exclusive to ECS. ECS is fundamentally a pattern that describes entities as a generic collection of handles. You dont need an overengineered ECS library to add handles to your engine.
I feel like what you mean is you can implement OOP on top of handles, yes this is correct and what you 100% should be doing. Quake 3 in 1999 was using handles, many, many engines use handles. Godot for example implements its OOP nodes on top of handles (RIDs).

>>102107199
Behold ECS spaghetti: https://captain-of-coit.github.io/cs2-ecs-explorer/#
And the best part is the game runs like trash still, ecs fanboys be seething when its used for more than drawing 1,000,000 floating cubes
>>
>>102149983
What's so amazing about handles?
>>
>>102149983
It puzzles me that I see shit like "HomelessShelterAISystem", how can complex things like this be expressed as one single function?
>>
File: GSeHHgJWoAABDTT.jpg (91 KB, 900x1500)
91 KB
91 KB JPG
>>102107040
averiCHADs stay winning
>>
>>102149983
It's possible to define your entities in data, which you should do. Then you add "parent" to said definition just to add or change some components. So you can have "entitiy class" defined in data. Other entities don't know what exactly they're dealing with. Only way to communicate is to send messages to other entities by warious ways. I've shipped game on ECS around 5 years ago and I used special "message components" that system might handle. Like I added WantPickup component on anything that player touched, then CoinPickupSystem handled all entities with combination Coin and WantPickup to actually pick it. And it wasn't connected to visual representation at all. Other entities weren't affected and special system cleared all message components at the end of the frame. So it's basically OOP, better than in most OOP languages.
>>
>>102150286
The example you described could be so much simpler if it wasn't ECS
>>
Thoughts on the new sdl3 gpu api?
>>
>>102149983
What's a handle?
>>
>>102150390
they are taking it from this guy's engine https://moonside.games/posts/
since he's shipped a bunch of games it should be decent
>>
>>102150331
It's actually easier than it looks. Code is really simple and it's very clear what exactly it does, hard to do something unintended. Really easy to write tests for. It starting to shine once you have a lot of other systems.
>>102150510
A number basically. Or it might be a pointer. Or anything else that might be represented as number.
>>
>>102150901
I know exactly how easy it is and just doing it without ECS would be easier
ECS is the new OOP, write a bunch of useless boilerplate code for no reason
>>
you have a player inventory. the player's inventory can contain bags which have another inventory, with infinite recursion. how do I implement this in an ECS component?
>>
>>102150510
I suppose a pointer is a handle too (I use pointers in addition), but I mean using an integer as some identifier for data thats stored elsewhere like
template<typename T>
struct handle
{
int id = -1;
bool is_valid() const { return id != -1; }
};

So for example, you have a renderable handle. The renderable stores a model and a transform and some render settings. You use the renderable handle to update the renderable's data, such as updating the transform. The advantage is that the renderer doesnt care about who owns the renderables handles, it just has a bunch of renderables that it can iterate over to draw.
struct Renderable
{
Model* m = nullptr;
mat4 transform;
};
class Renderer
{
handle<Renderable> register_renderable();
void update_renderable(handle<Renderable> handle, Renderable data);
void remove_renderable(handle<Renderable> handle);
};

So anybody can own the renderable handle. If you're using a Unity/Unreal like component model, maybe a MeshComponent, BillboardComponent, or anything else owns a renderable handle. If youre making an RTS game with 1000s of units, you can skip the components and use straight handles to draw stuff. Its super flexible and decouples the owner from the data. The renderer is *never* going to iterate over the owners to pull data, owners are the only ones allowed to push data into handles.
Apply the handle pattern to more stuff: lights, decals, cubemaps, audio sources, particles, physics bodies, etc.
Its similar to ECS, but different. ECS components are never independent, theyre attached to more components, and the idomatic way of using ECS is to split component data into multiple arrays. You never do this with handles, all of the handle's internal data is in one struct, its an independent unit. ECS tries to be to generic and fails.
>>
>>102150962
Add "ParentContainer" and "Container" components. So you can query all entities that are in said container.
>>
>>102150621
i like this quote from his ecs article
>Why was I listening to a bunch of people who have never made a game with their own tools? What was I thinking?
>>
>>102150984
Everything you're describing is accomplished by a pointer
>>
>>102150991
Yes let's add a component for literally everything
Think of the memory fragmentation
>>
>>102151000
True, the one thing I didnt mention is that an integer lets you have one layer of indirection so you can pack the actual data in flat arrays in memory. Downside is slower accesses, but the most common case is iterating over static stuff that gets updated infrequently, so extra time for accesses isnt that bad.
Point being, its not like the handle pattern is anything new that I created. Its a basic part of programming. I just wish people mentioned it more instead of going straight to ECS since handles basically accomplish all of what you need.
>>
>>102151000
There's a thing about handles. You can put actual data somewhere else or move it around. And handle can be invalid too. There's no way to know if pointer is valid or not.
>>
>>102151033
>an integer lets you have one layer of indirection so you can pack the actual data in flat arrays in memory
You can do this with a pointer too
>>
>>102151039
>And handle can be invalid too. There's no way to know if pointer is valid or not.
A pointer is invalid if it points to invalid memory
A handle is invalid if it... handles to a invalid location
They're literally the same thing
>>
>>102151042
>>102151061
It would have to be a pointer to a pointer, which is the same thing as an integer id (which is an offset in an indirection array).
Im not sure you get it, its the reason why you cant have memory defragmented behind the scenes, pointers are pointing to a piece of memory , you cant change what memory its looking at.
>>
>>102151074
A pointer is a integer that is an address to another location
A handle is a integer that is an address to another location
What is the difference?
>>
>>102151061
> A pointer is invalid if it points to invalid memory
But there's no way for you to know that. For something like generational handle you can ask if it still valid or not.
>>
>>102151104
yeah or a generational pointer
>>
>>102151094
Okay my bad (genuinely), I didnt explain it fully at the start
Basically it looks like

int my_handle;

int indirection_array[]
ActualData data_array[]

my_data = data_array[indirection_array[my_handle]]


So then the handle is always pointing to somewhere in the indirection_array, but you can move the data_array stuff around.
>>
>>102151124
so what's the point in doing this
>>
>>102151000
sounds autistic, I would just put a pointer to an object in the component struct and implement a saving/loading procedure for it.
>>
>>102151167
>>102150991
oops I repwied to the wong post
>>
>>102151146
The main reason is that then the system (renderer in my example) will never look at the indirection_array, but just loop over the data_array. So it can avoid cache misses as the data is all next to each other.
Tbh it 100% can be pointers and you still get the advantage of decoupling the data from the owner. (I use pointers for the physics system in my engine instead of integer handles). But you get some performance advantages this way when iterating over lots of stuff. And for a renderer, theres likely going to be a lot of stuff (10k+ objects) and they dont update frequently so it makes sense.
>>
>>102151187
That's still exactly what a pointer does, and if you're looping over every renderable object instead of using a spatial parition you're doing it wrong
You should think more about what you're doing
>>
>>102151200
Not really, a pointer would mean *every single* lookup in the data_array is a dereference which would wreck your cache when iterating thousands of objects.
And for spatial partitions for renderables, I skip that. I do culling on the GPU, its faster to blaze through objects then doing some quad-tree nonsense on the CPU.
>>
>>102151227
>Not really, a pointer would mean *every single* lookup in the data_array is a dereference
Using a handle is also a deference
>its faster to blaze through objects then doing some quad-tree nonsense on the CPU
Depends on how many objects you have, it's O(log N) vs O(n)
Also you typically want to sort renderables after you cull them too, are you gonna do that on the GPU aswell?
>>
Handles are good for all sorts of resources. You don't deference them most of the time, you just need something that points on it. And to be sure that game won't crash if resource isn't there anymore. And without exposing internals to client code. Like if you have scene then you want to move actual nodes around memory for better cache utilization.
>>
>>102151283
Still waiting for someone to figure out the difference between a handle and a pointer
>>
>>102151293
having a pointer to something that constantly moves around in memory is bad
>>
>>102151293
It's kind of doesn't actually matter, just a thing that points to other thing. Only difference is that handles usually are safe to dereference.
>>
>>102151264
>Using a handle is also a deference
Thats the tradeoff, are you iterating more or updating more?
A game scene is usually 99% static stuff, much more stuff is static then updating every frame.
>Also you typically want to sort renderables after you cull them too
I do sorting+batching on the CPU before culling, then I cull on the GPU and issue a multidrawindirect. The O(N) vs O(log N) is true, but sometimes brute force is fastest when you have lots of data instead of dealing with indirections like a spatial structure. Even if you arent culling on the GPU, EA did a presentation about culling in BF3, they found ditching their quadtree and focusing on minimal indirections resulted in faster culling on the CPU.
>>
>>102151314
they are literally both integers that hold an address to something else, this guys been talking about them for like 30 posts and he still can't articulate what he thinks the difference is
>>
>>102151321
>Thats the tradeoff, are you iterating more or updating more?
A pointer and a handle deference in exactly the same way, it's all the same to a computer
>I do sorting+batching on the CPU before culling, then I cull on the GPU
But you want to sort a smaller list
You want to take your scene of 100,000 renderables, get the 1,000 renderables you have to draw, then sort them
not sort 100,000 renderables then find the 1,000 you want to draw
>>
>>102151324
>a white and a nigger are both human beings I can't figure out why one keeps committing crime
>>
>>102151346
>A pointer and a handle deference in exactly the same way, it's all the same to a computer
No they dont, the handle has an extra indirection cost, the data_array doesnt. I dont understand why you dont get this.
my_data = data_array[index]
// vs
my_data = data_array[indirection_array[my_handle]]

>But you want to sort a smaller list
Well, sorting of static stuff can be cached easily. I've thought about it for my renderer but havent implemented it since its not a performance issue. Sorting everything each frame isnt a big issue for ~10k objects for me.
>>
>>102151324
He probably has in mind the idea of building an API where you get optional everytime you try to use the handles like this:
proc foo(this: Handle): Optional[Foo] =
if entityList[this.index].generation == this.generation:
return some(entityList[this.index])
>>
>>102151390
>since its not a performance issue.
But you're trying to justify all the things you're talking about by saying they're better for performance
Sorted renderables can't be cached easily, unless you have a fixed camera
You aren't thinking clearly, you don't understand what you're doing
>>
>>102151412
>Sorted renderables can't be cached easily, unless you have a fixed camera
How much of your scene is transparents? Tiny. 99% is static, 99% of that is opaque. Dont be obtuse. Its easy to cache.
You arent thinking clearly. Caching is very basic. I could add it right now in 15 minutes. Its not a big deal.
>>
>>102151427
Turn the camera around and suddenly your cached sort is completely invalid
You should sort every renderable by material to minimize stage changes
>>
>>102151443
???
You have no idea what your talking about. The entire set of *opaque* objects is sorted by material once. That its completely independent of where the camera is. It never becomes "invalid" because the camera turned around. It obviously becomes invalid if you add new objects into the scene, but that only happens on level load. Its easy to cache.
The only view dependent sort is transparents, which has to be stored separately anyways to render in a different pass.

Like have you even written a renderer before?
>>
>>102151467
If youre talking about draw commands, thats generated on the GPU after culling. Yes obviously you regenerate those every frame. But its already in a sorted state.
>>
>>102151467
The transparent objects become invalid when you move the camera
The opaque list changes based on what's actually in the scene, which changes throughout the level
>>
Well that's the last time I ask a question here
>>
>>102151502
If you have streaming levels then yes.
Then you sort again.
Youre criticizing a really simple approach with handles and a flat array of objects. Im very curious to see how your engine deals with this, supposedly scaling flawlessly to 100k objects.
>>
>>102151526
My engine could scale to millions of objects because it uses the (normal) approach of doing things on the CPU with spatial partitions
You're using a newer GPU driven approach
>>
>>102150032
>>102150510
https://floooh.github.io/2018/06/17/handles-vs-pointers.html
>>
>>102152111
I often see people talking about how heap allocation is so slow and big objects full of lots of heap allocations is bad yet games still seem to work fine when they do this
>>
"Premature optimization is the root of all evil" - some boomer
>>
>>102152246
it is a waste of time yes but also kinda fun
>>
>Glad I spent all my youth optimizing a binary search algorithm ...



[Advertise on 4chan]

Delete Post: [File Only] Style:
[Disable Mobile View / Use Desktop Site]

[Enable Mobile View / Use Mobile Site]

All trademarks and copyrights on this page are owned by their respective parties. Images uploaded are the responsibility of the Poster. Comments are owned by the Poster.