[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]


File: file.png (62 KB, 965x427)
62 KB
62 KB PNG
DirectX 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: >>102005995
>>
I started writing a gameboy emulator on a whim last night, in pure C
I'm having a blast
I haven't decided on what I'll use for the UI/graphic lib, maybe plain SDL
>>
Where can I learn more about ecs?
It seems kinda cool.
>>
>>102063351
we don't use that word in this house
>>
>>102063382
What's the alternative then?
>>
>>102063388
OOP except done correctly
>>
>>102063429
What if my language doesn't support classes or any sort of objects. Context - I'm using Odin.
>>
>>102063351
part of the experience is reading about it and implementing it yourself. a lot of them depends on the language your doing anyways, bevy is heavily using rust macros and models, entt on c++ does too.
ask yourself a question tho, how many entities will you ever have? and are you doing runtime behaviour change for entities? most ecs libraries are static, they're like a retarded type system built on top of the normal language type system.
>>
>>102063441
you don't need objects for OOP, all you need is structs
>>
>>102063388
Regular composition
You have an Entity, it has references to a Renderable component, a Collidable component, a Behaviour component
>>
>>102063477
That's just feels like ECS with extra steps. How is that different than ECS. Sorry I'm retard. Help.
>>
>>102063501
No that's ECS with less steps
in ECS "entities" don't even exist, an entity is a column in a database
>>
>>102063501
just don't call it ECS, you can make it work just like ECS, but call it OOP, that makes it okay
>>
>>102063501
OOP = struct that holds references to components
ECS = struct of arrays that hold all components, entity is just index into array
a lot of the time people build an entity object on top of the ECS anyway lel
>>
Just a small revelation, how comes update functions always operate on a single object each time, instead of operating on a dense array? that way even if you're using function pointers, you only pay for the dereference one type per group call. I started to provide array version of most functions I have.
>>
>>102063647
When you talk about optimizations you need to consider the context you're operating in
The cost of dereferencing is very small and is not an issue for most code
>>
what exactly is the problem that ECS solves?
>>
>>102063912
speed, they managed to make mario64 run twice as fast by ditching linked lists and packing data together. it allowed modders to have bigger and richer levels. the value of that depends on the game.
>>
>>102063949
That's not ECS
>>
>>102064027
it's what ecs is about tho.
>>
>>102063949
oh so it's a tranny thing, I get it now
>>
>>102064053
He asked what problem ECS solved
To that the answer is "one the inventor of ECS made up in his head"
>>
trannies made a game from 1996 run faster and can build bigger levels so now we're all supposed to ditch tried and tested solutions that work at scale for the new hot tranny tech
>>
>>102064111
Replacing a linked list with an array isn't ECS
>>
>>102064169
data-oriented design, whatever, you get what he means
>>
>>102063912
Literally just cache coherency. Only use it if performance is a concern.
>>
>>102064205
data oriented design = good
ECS = bad
>>
>>102064111
something that's useful for modders will be useful for the devs themselves, you don't have to go full retard about it.
>>
>>102064211
Sounds like an extreme form of premature optimization to me
>>
>>102064230
>premature optimization
If you want to make a performant game engine you need to get that idea out of your head, we are making up-front design decisions as a necessity of the craft. That term is really only useful for video games themselves, where fast iteration and prototyping should come before optimization.
>>
>>102064295
ECS is an optimization for an area of a game that isn't slow
>>
>>102064314
That depends entirely on the game
>>
>>102064358
I can't think of any games where ECS would be the best optimization strategy
>>
>>102064295
>we are making up-front design decisions as a necessity of the craft
Who's we? Mario 64 speedrunners and University lecturers?
>>
>>102064385
I can think of plenty, in fact ECS is almost always at least marginally faster than vanilla OOP. There's only a tiny bit of overhead.
>>102064391
Not sure what you're talking about. My game engine uses ECS. If you aren't working on a game engine then I didn't mean to include you. Sorry!
>>
>>102064425
>I can think of plenty
Because you don't know anything about optimization
Games don't consist of large amounts of objects with simple self-contained behaviours
>>
>>102064425
Ok well I'm sure you've made plenty of games with that game engine that highlight the performance benefits of an ECS
>>
>>102064478
There is so little overhead with ECS that even a few NPCs running around would justify it.
>>102064491
Nope, I am solely an engine dev right now
>>
>>102064530
>There is so little overhead with ECS
The overhead is it's a terrible architecture to actually write code with
>>
>>102064543
That's fair. I started this conversation by saying to only use it if performance is a concern
>>
>>102064571
When performance becomes a concern you can optimize that specific area of the program
ECS is architecture that makes you write very clunky code to optimize every single section of gameplay code
>>
>>102064425
>ECS follows the principle of composition over inheritance, meaning that every entity is defined not by a type hierarchy, but by the components that are associated with it. Systems act globally over all entities which have the required components.

This is mostly nonsense. You can use inheritance in the same way as composition, using templates instead of virtuals, and then get all of the benefits of ECS without having to pass around references everywhere.
>>
>>102064602
>When performance becomes a concern you can optimize that specific area of the program
It is better to implement this type of system up front. I'm pretty sure Unity has spent tens of millions of dollars trying to retrofit it into their game engine because they didn't have the foresight to implement it earlier.
>ECS is architecture that makes you write very clunky code to optimize every single section of gameplay code
It's a little clunky yeah, what can I say
>>102064622
The whole point of using composition in the case of ECS is so that the components are tightly packed in arrays that be iterated over for cache coherence purposes.
>>
>>102064670
>It is better to implement this type of system up front.
No it's not, because then you've created a generic architecture that's terrible for most of the jobs you've designed to do
>>
>>102064670
>The whole point of using composition in the case of ECS is so that the components are tightly packed in arrays that be iterated over for cache coherence purposes.
You can still do that with inheritance. Ex. You have a Manager class or struct that you inherit from which contains those arrays, then as the hierarchy is traversed each child adds its data to those arrays.
>>
>>102064686
> that's terrible for most of the jobs you've designed to do
Your argument still boils down to "ECS bad"
>>102064711
>adds its data to those arrays.
Not sure what you mean by this. Are you suggesting objects should have copies of their data in these manager classes and update them every single time the data is mutated? That sounds awful.
>>
>>102064790
ECS sucks because it's a real pain in the ass to actually write your code, for performance in areas where it dosn't even matter
I'll give you an example. Let's say I'm making an RTS game like They Are Billions, something that has tens of thousands of units so you might think "this is a good job for ECS"

If I were making this game I would optimize it like this:
>GUI elements are inherited OOP objects in a tree structure
>Game map is a grid of references to units in the grid
>Game units are a single type structs stored inside an array that contain every possible option for a unit
This is both fast as easy to work with

If it were ECS, writing your GUI logic is going to be fucking horrible as you deal with component and system spaghetti trying to flatten something that should be a tree into an array, and dealing with your units is also going to be more complex than it should be as you break down your units which could simply just be one structure down into a bunch of components and seperate systems
>>
>>102064790
No, not copies. You do inheritance chains. So one struct/class would inherit from the Manager, then another one inherits from that one. It does look awful at first but then you can create a chaining template that collapses the whole thing into a single list of classes/structs where each class is automatically attached to N-1.

Then within each class you have a bunch of using statements to say which behavior you want to select from any of the prior classes in the chain. This is not strictly necessary but great for determining what the class actually depends on.

Another added benefit to this technique is that you can create brand new chains without affecting working ones. So if you want to modify or replace a class that is no longer suitable to the task you put it in a different namespace and do your testing without breaking the original code. If everything is good you go back and replace it.

Your using statement is where you assemble a chain of classes into one coherent whole, selecting which bits and pieces of a library you want for that particular use. That's where you get the same effects of composition.
>>
>show me where OOP touched you
>>
>>102064884
>Let's say I'm making an RTS game like They Are Billions, something that has tens of thousands of units so you might think "this is a good job for ECS"
Noita, aka the game where it simulates every single pixel in multiple screens, with widely different behaviours, immergent and intentional, is using ECS. you're really retarded.
>>
>>102065101
You haven't made a point
>>
>>102065101
You've made a point.
>>
>52 unfiltered shitposts
nice thread guys
>>
>>102065580
That's what you get for asking questions I guess
>>
imagine if all the crabs left and we united with /agdg/ for ideaguys and graphics to have one nice thread without pointless arguments
>>
>>102065101
Wrong, no game has ever used ECS
>>
>>102063351
if you haven't started yet, don't
it's a fucking cargo cult at this point
>>
>>102065101
>a fucking sand simulation
>>
I never really get why people are so obsessed over the cpu cache in the context of the simulation layer when their game only has less than 100 objects in it 90% of the time.
>>
>>102065947
Because they've never made a game and just read articles from "smart" people on the internet
>>
>>102065643
If all Windows, Mac, Pust, Zig and Go users were filtered, and if some actual pixel artist came here, we could make a fun game.
If people who knew to develop individual "packages" required for a complete game were here, we could organize the work over IRC.
If those people would do their work, one does LA, one GL/FW, one AL, one 20% pixel art, other 20% more, we'd have an actual /g/ame.
--
But I doubt that'll happen anytime soon, as only Froggy, GUI Anon, me and several more Anons post actual project screenshots.
Other people just ramble about why is ECS "god-sent", why we'll never finish, why we should(n't) use language X or Y... Sad.
>>
>>102065985
I'm a pixel artist
>>
>>102066004
>>102062659
WE HAVE AN ARTIST HERE... At least 2 more artists, and 2 more C programmers.
-- Verification n o t required.
>>
>>102065947
that's only the case for 90% of 2D games, it's why I don't care how they're made, even if you use Lua, it's really hard to hit a bottleneck unless you're making the next factorio.
for 3D tho? it's way easier to screw the performance. even innocent simple code can lead to disaster, because rendering API are hot garbage and there's a million way to do the same thing, 99% of which are bad/outdated.
>>
>>102066082
It's the case for any game
Noita might be one of the only games in the world that actually maps to ECS
>>
>>102065985
>If all Windows, Mac, Pust, Zig and Go users were filtered
why are you being mean spirited? just say you're a linux fanboy. linux is not for gaming.
also hating on Zig is just weird, it's just C 2.0, i treat C and Zig interchangeably. Go users are okay too. don't tell me you're an Odin fag.
>and if some actual pixel artist came here
lmao, more pixel shit games? for what reason? I respect every single 3D game here even if it sucked. pixel trash should stay in /agdg/
>>
>>102066171
I'm mainly Adafag, but I enjoy writing C a lot, and I love Fortran. Sometimes I write assembly, just in order not to forget some things.
>>
>>102066092
Bitsquid/Stingray had ECS, so Helldivers 2 is an ECS game.
>>
>>102066171
Also, I don't use memelangs like C3, Odin, Pust, Zig, Go, Nim and many many others, I prefer boomer languages. Zig is ugly, sorry.
>>
>>102066197
I'm not saying people don't use it, I'm saying it's a poor fit for the job
>>
>>102065947
>their game only has less than 100 objects in it
Nobody is suggesting ECS for baby's first game jam
>>
>>102066322
Go play an AAA game and consider how many enemies you fight at once
>>
>>102066343
Entity =/= NPC
>>
>>102066420
An entity is an object that's doing something
How many entities do you think you need in your average AAA combat encounter vs 5 bad guys
>>
>>102066434
>An entity is an object that's doing something
>How many entities do you think you need in your average AAA combat encounter vs 5 bad guys
I just want to let you know that you're completely wrong. There can easily be thousands of entities in a typical AAA type level. It isn't just characters.

I can see why you've been shitting up the thread all this time now, though. You just misunderstood ECS altogether.
>>
>>102066474
>here can easily be thousands of entities in a typical AAA type level
Exactly, you think "thousands" is a lot?
>>
>>102066492
Just a minute ago you were asking how many enemies you fight in a typical AAA game. Why did you lose interest in that line of questioning?
>>
>>102066523
Because that question was already answered? what the fuck are you talking about
>>
>>102066322
>Nobody is suggesting ECS for baby's first game jam
Yes they are
>>
>>102066537
Where?
>>102066561
Who?
>>
>>102066601
The average AAA game has you fighting 5-10 enemies at once
But yeah, we need ECS to handle this
>>
embarrassing, we're getting /agdg/ level of cringe and we don't even have cris
>>
>>102066615
>The average AAA game has you fighting 5-10 enemies at once
Explain why that figure is pertinent to the discussion of ECS.
>>
>>102066657
you don't need a lot of logical objects to model this scenario
>>
>>102066657
ECS is only relevant when there are millions of entities interacting directly with the player at the same time.
>>
>>102066601
ECS is being promoted as a general purpose architecture and not just an optimization strategy for highly specialized use cases
>>
>>102066668
>logical objects
This is a data-oriented system, just about everything is an entity in a game. A completely static model of a coffee mug is an entity with a transform, mesh and material component which all need to be iterated ever single frame. It does add up. And to address >>102066672 it is something that can be benchmarked and your numbers are provably incorrect.
>>102066703
If they aren't ITT then who cares
>>
>>102066737
>A completely static model of a coffee mug is an entity with a transform, mesh and material component which all need to be iterated ever single frame
ever heard of batching bro
>>
File: 1724526712137.gif (3.83 MB, 224x365)
3.83 MB
3.83 MB GIF
>>102062659
>g_
KEK
>>
>>102062659
I've been having fun with Love2d.
It runs very well, even on my potato toaster, and I'm enjoying Lua.
Tables are pretty damn cool.

I had investigated Pygame a while back, but a blank Pygame window ran full bore, pulling 100% of the core it was running on.
Like, nigga I shouldn't have to add shit to constrain the engine/framework from doing that.
>>
nobody really gave me an answer for this, how do I have a much nicer api to work with on top of opengl? I'm getting annoyed by gl.genbuffers, gl.genarray, etc etc. Anything I can look for reference.
>>
>>102069178
I gave you an answer
>>
>>102062659
something i've learned while working on my current project is that it's very hard to make an elegant puzzle game mechanic - it's far easier to make a mechanic that's too easy or lacks depth, or on the other hand, make a mechanic that's too difficult and incomprehensible to noob players.

it's not that the mechanic i came up with sucked, it's just that it ended up taking a lot of hand-holding and fine-tweaking to make the prototype game any fun at all, and it's honestly making me rethink the project. it's not that i'm out of ideas for the mechanic, but adding much more to it will definitely make it too hard to understand.

what do?
>>
>>102069259
Is this why it's taken Jon Blow 10 years to make a Sokoban clone?
>>
>>102069259
A shot in the dark here, but I find that imperfection adds sovl.
I.e, in my little shooter I've been tinkering with, adding a thing to exactly constrain the ship's speed to it's intended value actually caused more problems than letting it be a little sloppy and end up at 509.373636 speed instead of exactly 500.
>>
This is an external shadeder txt file loader
const char*
shader::getFileSource(const char* filePath)
{
static std::string fileCode;
std::ifstream fileFile;
fileFile.exceptions( std::ifstream::failbit | std::ifstream::badbit);
try
{
fileFile.open(filePath);
std::stringstream fileStream;
fileStream << fileFile.rdbuf();
fileFile.close();
fileCode = fileStream.str();
}
catch (const std::ifstream::failure& e)
{
std::cout << "ERROR: Couldn't Retrieve " << filePath << " \n" << e.what() << std::endl;
}

return fileCode.c_str();
}


shader::shader(const char* vertexFilePath, const char* fragmentFilePath)
{
const char* vertexShaderSource = getFileSource(vertexFilePath);

vertexShader = glCreateShader(GL_VERTEX_SHADER);
glShaderSource(vertexShader, 1, &vertexShaderSource, NULL);
glCompileShader(vertexShader);
shader::checkErrors(vertexShader, false);

// FIXME:
// getFileSource has to be called one by one
// otherwise it will overwrite source files
// I couldn't debug this so it will stay like that.

const char* fragmentShaderSource = getFileSource(fragmentFilePath);
fragmentShader = glCreateShader(GL_FRAGMENT_SHADER);
glShaderSource(fragmentShader, 1, &fragmentShaderSource, NULL);
glCompileShader(fragmentShader);
shader::checkErrors(fragmentShader, false);

shaderProgramID = glCreateProgram();
glAttachShader(shaderProgramID, vertexShader);
glAttachShader(shaderProgramID, fragmentShader);
glLinkProgram(shaderProgramID);
shader::checkErrors(shaderProgramID, true);

glDeleteShader(vertexShader);
glDeleteShader(fragmentShader);
}

It is very buggy. My program was giving random segmentation faults sometimes when I launch, and debugger points to these things(?).
How can I improve this function? I remember barely coding this from stack overflow
>>
>>102070714
Try learning to program instead of using ChatGPT
>>
>>102070714
Just return the string, don’t use a static string and don’t return a pointer from it.
>>
>>102071280
Yeah I fixed the retarded part, but still I have the seg fault
I have a very big vertice vector<int> (3 coord, 3 color data) that generates vertices via func

in this function
void
render::setBuffer(std::vector<float> vertice)
{
std::cout << static_cast<long long int>(6* sizeof(float) * vertice.size()) << std::endl; // approx 6.000.000
glBufferData(GL_ARRAY_BUFFER, static_cast<long long int>(6* sizeof(float) * vertice.size()), &vertice[0], GL_STATIC_DRAW);

glVertexAttribPointer(0, 3, GL_FLOAT, GL_FALSE, 6 * sizeof(float), reinterpret_cast<void*>(0));
glEnableVertexAttribArray(0);
glVertexAttribPointer(1, 3, GL_FLOAT, GL_FALSE, 6 * sizeof(float), reinterpret_cast<void*>(3*sizeof(float)));
glEnableVertexAttribArray(1);
}

glbufferdata throws segmentation fault.
I CAN decrease the number of vertices in my vector, and then the programs starts to work.
What is the best way to work with big data?
>>
>>102071737
> vector that generates vertices
I meant I have an additional utility function that generates vertices for me, I can tweak the values and, whatever.
Here is the function
void
graph::pointGenerator()
{
for(float i = -1.0; i < 1; i += 0.2)
{
for(float j = -1.0; j < 1; j += 0.2)
{
gridVertices.push_back(-i);
gridVertices.push_back(-j);
gridVertices.push_back(-pow(i, 2) -pow(j, 2));
gridVertices.push_back(1.0);
gridVertices.push_back(0.0);
gridVertices.push_back(0.0);
n++; // counts the number of parabole vertices
}
}
}
>>
File: 1724305811771666.png (213 KB, 442x420)
213 KB
213 KB PNG
>ECS BAD!
>PIXELART BAD!
...and Godot has ZERO succesful games to prove it!
>>
>>102071737
Don’t multiply by 6 here, the size of the vector is already accounting for that.
>>
>>102071737
>>102072156
You’ll still need the multiply by 6 for the stride, just not for the upload of data.
Also, use fmt or std::print/std::format.
>>
>>102069178
you could look at the Hazel engine, the codebase is pretty small and easy to understand. its not in Odin though, but the abstraction ideas are there
>>
>>102072178
I get it, but how can I avoid the seg fault?
glbufferdata throws the error when the vertice vector is large enough
>>
>>102072668
So you removed the multiply by 6 and that didn’t fix it? Are you binding the buffer before you try and write to it?

At how many vertices does it crash? Are you compiling for 32 or 64bit?
>>
>>102072866
Sorry, I mixed the 6's we were talking about, yeah removing it fixed it.
>>
>>102069259
https://www.youtube.com/watch?v=HAvS-RwkjdA
making puzzles is a hard iterative process, there's nothing around it even if you're a natural genius.
>>
>>102073177
puzzles are gay
>>
>>102073578
maybe, but until recently it was one of the most successful genre for indie games. not sure if it's still is tho.
>>
>>102073605
nah it was shit
puzzles were always cope from people jelly of sid meier and the likes, who made superior tactical games for male brains
>>
>>102069298
he is busy saving the universe.
from communism.
>>
>>102073620
it doesn't change the fact that puzzle games are the easiest to make assets and (arguably) mechanics for. you just see how much you can milk the same basic blocks for the maximum amount of level. they also tend to have no story too.
>>
>>102073691
no the easiest possible thing you can do is to ask blackrock esg for troon funds to make your bankruptcy sloppa
>>
will video game graphics look better than today in 15 years?

if we take the example of movie CGI many people easily argue that it has gotten worse in the last 15 years
>>
>>102066638
sadly we do too. he was in the last thread.
>>
>>102073891
We're getting into the uncanny valley of graphic. and since I don't think we can achieve "real world" realtime graphic anytime soon, we'll stay in the valley. and anything that doesn't look real will be an eye sore.
I'm of the opinion that the pursuit of realistic graphic is a fool's errand.
>>
File: 1695465765680353.png (609 KB, 695x924)
609 KB
609 KB PNG
"Memory leaks could be here" he thought, "I've never used this language before. There could be Memory leaks anywhere." The cool wind felt good against his bare chest. "I HATE MEMORY LEAKS" he thought. Livestreamed lofi hip hop reverberated his entire car, making it pulsate even as the $2 energy drinks circulated through his powerful thick veins and washed away his (merited) fear of mismanaged memory allocation. "With a compiler, you can make anything you want" he said to himself, out loud.
>>
>>102074853
kek
>>
>>102074853
I say this but I drink coffee
>>
>>102073891
Why would you want hyper realistic videogames? I thought half the appeal was they weren’t real.
>>
>>102073891
well if smart people didn't waste all their time making sand simulations and drawing pixelshit sprites for their Metroid clones we might get there
>>
File: file.png (1.59 MB, 1536x864)
1.59 MB
1.59 MB PNG
my russian wife just made more progress!
https://www.youtube.com/watch?v=xOaztlVzoMs
>>
I’m not sure if this is the right place to ask but does anyone know if I need a license from engine companies to be a support team for foreign devs working on it? Say a few countries who doesn’t have native language support from the engine & its tutorials is interested in making a game. Then comes me, a person who knows said languages, acts as a support/technical dev company to help them learn the ropes and actively support their development with troubleshooting. Would I need a license or agreement with these companies to act as a middle man on how to use the engines?
>>
>>102076624
that's a man
>>
>>102076765
no adam's apple, no penis
still, that's more progress than all of you combined
>>
After examining all the advice in this thread I’m going to implement my ecs using linked lists.
>>
>>102077014
better to use hash maps
>>
>>102077014
that's one way to do it.
i made mine with a struct that contained arrays, metadata and a link to the next struct.
>>
File: 1.png (7 KB, 600x800)
7 KB
7 KB PNG
>>102066064
I'm a C programmer but I've never worked on a game engine and my only experience in game development involves Unity engine and C# 4 years ago and this is my first time opening this thread
>>
File: RedNeck_Dead.gif (64 KB, 256x256)
64 KB
64 KB GIF
Replaced my rendering system with discrete "effects" instead (just C++ files which manage the bindings for each draw call). Previously, model objects managed textures and meshes and bound them when you called model->draw(), but this was inflexible and ended up being really ugly, so I ripped it out and flattened the code instead. i.e:

void BillboardAnimationEffect::apply() const
{
SpriteAnimationBuffer buffer;
auto texture = m_animation->getTexture();
buffer.m_src = XMFLOAT4(
(m_animation->getFrameWidth() / static_cast<f32>(texture->getWidth())) * static_cast<f32>(m_animation->getFrame()),
(m_animation->getFrameHeight() / static_cast<f32>(texture->getHeight())) * static_cast<f32>(m_animation->getRowNumber()),
(m_animation->getFrameWidth() / static_cast<f32>(texture->getWidth())),
(m_animation->getFrameHeight() / static_cast<f32>(texture->getHeight()))
);
buffer.m_dest = XMFLOAT4(0, 0, 0, 0);
buffer.m_angle = 0.0f;
buffer.m_opacity = 1.0f;

m_shader->bindCBuffer(&buffer);
m_shader->use(true);
texture->use();
for (auto const& vm : m_model->getViewModels())
{
auto const& mesh = vm.getMesh();

m_shader->bindModelBuffer(mesh->getModelTransform() * m_transform);
mesh->use();
mesh->drawIndexed();
}
}
>>
do you ever feel like this when you sit down and break down the game down to individual states and player io
https://www.youtube.com/watch?v=wQtZPNjc2gY
I love doing stuff from scratch
>>
>>102076624
wtf is that silver line on his face?
>>
>>102076790
it's a man
>>
>>102077565
only girls make progress tho
>>
>>102077693
you will never be a woman
>>
>>102077713
true, it's why i'm not doing any progress, where's yours tho.
>>
>>102077753
>spamming Youtube videos of a Russian tranny is progress
>>
>>102077515
tranny trick to direct the light and make his manlike features appear softer
>>
>>102077786
it's the only image related to enginedev other than the OP, i always use an image from the thread to make the new thread, and you retards are not posting any progress besides ecs bait and shitposts.
>>
>>102077515
maybe he's an Adam Ant fan
https://www.youtube.com/watch?v=4B2a6l6wM2k
>>
>>102077891
>image
you literally linked a video you troon retard
>>
>>102077947
it's pic related you blind fuck
>>
>>102078039
how is posting videos of a Russian tranny Youtuber progress?
>>
>>102078070
your autistic sperging is also not progress, we're almost 150 posts in, no progress in sight.
>>
>*posts screencap from a video of a man pretending to be a woman*
>"uhhh why aren't you guys posting progress like me?"
kys troon
>>
File: dog4.gif (12 KB, 175x175)
12 KB
12 KB GIF
ok guys, let me throw you a bone
an animation of a dog I made a while back, OC
yes, it's shit (I am a coder)
>>
>>102078134
Smug looking dog. Very nice anon
>>
>>102076790
>>102077891
Why do you keep asking people to post progress, have YOU posted progress ITT?
>>
God I hate opengl so fucking much it's unreal.
Do people really use this raw version to make games?
>>
>>102078257
>God I hate opengl
still better than Vulkan
>raw version
is there any other version? I stick with OpenGL ES 3.0 to be compatible with WebGL.
>>
Only chads use DirectX like in the OP
>>
>>102078220
thanks anon, made it to test sprite sheet loading and rendering
>>
I installed bullet physics and can see /usr/include/bullet/btBulletDynamicsCommon.h but the compiler won't let me included.

I haven't had this problem with anything else.
>>
>>102078257
What are you struggling with in OpenGL. It's the easiest of the graphics APIs…
>>
>>102063912
ECS in video games started around the early-mid 2000s as a reaction the deep inheritance hierarchies + dynamic polymorphism that predominated at the time. So the specific problems it tried to solve are things like
>What actually happens when I call an abstract update() on this object?
>Where can this slight variant on all the existing classes "fit" in the class hierarchy?

So it was about more freely customizing behavior and simplifying the architecture, instead of cargo culting OOP bullshit. The performance-focused stuff largely came later. OFC now ECS is now a cargo cult of its own, its historical context long forgotten.
>>
>>102079564
The performance-focused cargo culting bullshit is ECS
>>
>OOP BAD!
>>
>>102078945
>include *bullet*/btBulletDynamicsCommon.h
Retard.
>>
>>102079765
wtf do you think you're doing with that, retard?
>>
>>102076690
>I’m not sure if this is the right place to ask but does anyone know if I need a license from engine companies to be a support team for foreign devs working on it? Say a few countries who doesn’t have native language support from the engine & its tutorials is interested in making a game. Then comes me, a person who knows said languages, acts as a support/technical dev company to help them learn the ropes and actively support their development with troubleshooting. Would I need a license or agreement with these companies to act as a middle man on how to use the engines?
Anyone?
>>
>>102080197
I have no idea anon, I aint no filthy lawyer.
That said, if you did need a licence wouldnt that mean all those people making shitty youtube tutorials would be fucked? I cant imagine its an issue
>>
>>102080197
I doubt it but who knows. You will be replaced by AI before it becomes an issue anyway
>>
>>102080197
Are you actually using the engine yourself?
>>
File: 1715325529380229.gif (447 KB, 806x720)
447 KB
447 KB GIF
I regret trying to use Maybe() in Odin. In theory it has a lot of value, but its just tedious dealing with it imo. Might just go back to the tried and true "-1 means not assigned" strategy. Might not be "proper", but its comfy, easy, and as smooth as my brain.
>>
File: obey the monolith.jpg (9 KB, 336x150)
9 KB
9 KB JPG
not everything you do needs to be a library
>>
>>102080742
no one has ever proven that mathematically
>>
>>102080197
I don't believe you need any license or agreement. As long as you make it clear you're not affiliated with the company (Epic Games or Unity presumably). You can maybe get in trouble if you offer some sort of "certification" training courses on the engine.

That's just my experience having worked for enterprise corpo providers (Confluent), for what it's worth.
>>
>>102078257
Maybe you just need to practice with it more. I like Vulkan more but it isn't easy to get into at first. There are also libs that abstract over certain things like SDL and raylib.
>>
>>102080595
Ginger Shill is a fucking idiot for adding it to the language while simultaneously clinging to zero initialization like a working-class life raft in an ocean of terrifying, unpronounceable ivory towers
>>
>>102080595
you do you.
Maybe is the same as c++'s option or rust's result. But whenever I use Maybe, I end up using or_else and skip the exception hell I usually have to go through with other languages.
>Might not be "proper"
the creator of the language always encourages everyone to go with whatever they feel the most comfortable, that its fine to not do things the fancy way and stick to simple or "dumb" way of doing thing.
>>
>>102081115
I mean, it just feels clunky but it's my lack of experience speaking so yeah, I do need to practice more.
>>
>>102081146
Maybe is different from zero initialization. In Odin, an integer will have a zero value by default and that means that the integer is assigned a value of zero. But a Maybe integer will have a `nil` value which helps with making it more explicit if the integer has the value zero or wasn't assigned anything in the first place. How you will use these different behaviors in your workflow is up to you.
>>
>>102081146
>>102081295
what goes wrong in your life to make you a language zealot
>>
Veldrid is so confusing... I should probably kms. Fuck multiplatforming.
Why the fuck my mat4 uniform works on directx and vulkan, but not opengl...
>>
>>102082024
>multiplatforming
Seems to be a trap every aspiring enginedev falls into
>>
>>102081295
OK, I'll elaborate
All values in Odin are zero-initialized by default, including pointers, even non-nullable pointers
If you tell LLVM that a pointer cannot be null, and then tell it to go ahead and optimize, it will obediently remove a bunch of code based on the assumption that the pointer cannot be null, resulting in shitpiles of undefined behavior when it turns out to be zero-initialized, and therefore null
GB introduced Maybe, and non-nullable pointers, in response to criticisms of the ergonomics of always-nullable pointers, which is fine, but he also kept nullable pointers and zero-initialization, and then made the fucking Surprised Pikachu face when he ended up with "miscompilations"
This is not the first time he made an outrageously smoothbrained move, but for me it was the straw that broke the camel's back, and from now on I won't touch Odin unless there's a change in leadership
>>102081409
I would like to see Odin succeed but Ginger Bill is a tremendous fuckup
I don't think he can do the job
>>
>>102082302
Yeah I'm sure Ginger Bill is a "tremendous fuckup" because of trivial issues barely anyone cares about
>>
>>102082327
>trivial issues barely anyone cares about
Do you want your code to work, or not?
If you don't want it to work how you told it to, what do you want it to do instead?
>>
>>102082348
So Odin code doesn't work anymore because he introduced this bug and apparently didn't fix it even though he uses the language himself?
>>
>>102082367
He might have fixed it, but not before going on another ridiculous tirade blaming LLVM for everything he did wrong
I don't even know whether he eventually fixed it or not, because I don't fucking care, because at this point I wouldn't trust this guy to turn a light on without burning down his house
>>
>>102082409
You've got terminally online brainrot where you care more about the personalities behind it than the actual language
>>
>>102082302
>>102082327
people praise Ginger Bill all the time but he got exposed as a fucking brainlet tweeting about this issue
https://github.com/ziglang/zig/issues/5973
which isn't even Odin's, it's Zig's hidden pass by reference optimisation. Odin also suffers from it because LLVM, but the way he went on full damage control and attacked anybody who complained about it.
funny enough Odin issue tracker does not have a post about this, so anybody who attacks Zig for that issue is attacking Odin by default.
>>
>>102082910
>>102082428
>>
File: game.webm (2.72 MB, 1024x798)
2.72 MB
2.72 MB WEBM
Made less progress than I'd like. Kept smashing my head into glitches. But factions have random colours associated with them now, and your ships can colonise systems by flying near them
>>
>>102063441
Then you write really ugly OOP. See the Linux kernel for examples in C.
>>
>>102082910
What I don't understand... He makes function params immutable and you are then supposed to do "x := x" if you need mutation within a function... Why isn't this automated by the compiler?!
>>
>>102083971
Compilers can only auto-detect const in the same translation unit, if you want to export that function it needs to be explicit
>>
>>102062659
How does one track collision? I'm remaking my copy of castlevania in C++ with Raylib, I learned Godot before. But I'm stuck on collision beyond a for loop iterating every entity. I have an array of physics entities and use rectangle collision. But it is super tedious to work with (I have a huge switch case statement atm). In Godot I would just need to listen for a signal and provide a function that does something. All advice on the internet is either algos or generic advice, nothing regarding architecture, is the observer pattern or something similar good here?
>>
>>102084027
I would suggest you seperate collision from physics, the way generic engines handle this tends to suck because they lump these two things together which isn't optimal
If you're making a simple 2D game you should have some basic collision functions, like test if two objects overlap, test an object against the world and return a bool or a list of all collisions. You can then build the physics / movement of your game objects ontop of these functions
>>
>>102076624
I just saw a thread about her in the catalog. Be honest ... was it you?
>>
>>102083993
I don't understand. Doesn't it depend on calling convention which defines how params are passed to a function? The compiler then knows whether such param is possibly mutated within a function and can - simply speaking - just inject "x := x" at top of functions body?
>>
>>102084130
>test an object against the world
interesting idea anon, that would move the logic from the game loop inside each entity
/* Player, monster, etc. class that needs collision */
void update() {
Object *colls = world.checkCollision(this);
for (const auto &o : colls) {
switch () {
// ...
}
}
}

This would make it easier for me program for example a door that opens when players walks over an area. I'm ashamed atm to admit I did that with a switch case inside a switch case lol
>>
File: spacewar-2.webm (2.5 MB, 800x600)
2.5 MB
2.5 MB WEBM
>>102083813
What kind of game are you making? A space RTS? I've been working on this board game style thing for a few days, but I can't decide how to fix the issue of ships filling up all movement slots in a system.
>>
>>102084207
>that would move the logic from the game loop inside each entity
that's the idea, that's the best way to do it for a platformer
>>
>>102084189
>her
>>
>>102084237
Just an aside question, but I'm planning to move on after the refactor to make a real time strategy game. I learned that a quad tree or brute force method are the simplest options, and I was planning on having every unit be a circle collision. Any thing I should be aware of?
>>
>>102084528
Brute force is O(n^2) very bad for a game with lots of units like an RTS
Quad trees work and are the best generic solution, but if your units are all of the same size or of similar sizes then a grid works even better, each grid cell needs to be twice as wide as the maximum diameter of the largest unit, when you test for collisions you just take a sample of adjacent cells
>>
>>102084223
>What kind of game are you making? A space RTS?
Plan is a small scale grand strategy game, not 100% sure what I will do with it yet

>but I can't decide how to fix the issue of ships filling up all movement slots in a system.
Hmm, hard to say without know what you intentions are. But could show more an extra circle of slots as needed if you have more than 8 ships in a system? Or limit how many ships a faction can have in a system so they cant block out enemies?
>>
>>102084942
Emperor of the Fading Suns used a system where each player was assigned one slot around each planet, and up to 20 or so units could form into a stack. While I could do that, it would move away from the board game style, and the goal of making all information visible at a glance. I could expand the radius and make it more like a local system map, even including jump points like Space Empires, but that's pretty much a rewrite. The other real issue is that the number of ships grows to far too many, and then it's tedious to move them between systems. I could copy Master of Orion, but that has its own issues.
The end result is that I feel the original design was misguided or not well thought out enough. The cool part was that implementing AI and watching it play forced me to acknowledge those issues.
>>
I've having a interesting problem that I dont quite know how to solve. So i have a svg file which is supposed to be my game map, It's black (for land) and empty (for water).The i'm having is that I want the map to be pretty big. now with a svg I should be able to make it as big as I want but he game engine im using godot doesn't like that and even if I were able to use a massive svg/png as a game map that would cause a lot of performance issues.

The solution I've thought of to this was to split up the map into 4000 ish 640x640 png and then putting them back together in godot. However I don't have a simple way of doing that. Any ideas?
>>
>>102086299
Do you really need the WHOLE map?
What I mean is, could you just have a land tile, a water tile, and some shoreline tiles, then draw whatever you need by drawing copies of those?
>>
>>102086336
My main purpose for trying to use this method is the boundires for where the ships can sail in the waters. I could use a tilemap and all that but Im trying to make something that would be functionally 1:10 scale of real life with real life being 30km so 3km worth of map.

I pulled the svg from an actual terrain I though looked intresting and would make a good map. So If i am able to make this work I think it would look better and be easier than me trying to make one.
>>
>>102086394
I think i figured out what i can do. Im planning on converting the svg to a polygon directly (which is great because I've wanted to do that all along) It seems like i just need to hack a few scripts together
>>
today, ill buy more vape juice and dev for the first time in months
>>
File: file.png (133 KB, 749x751)
133 KB
133 KB PNG
I finally progressed beyond the triangle hell. Got myself a rotating cube in about 400 lines of rust.
Tons of unsafe code. I kinda want to try to create my own macros over unsafe things, so that I'll have a easier time. I wasn't that bad honestly. I had to pull in some crates. beryllium(sdl wrapper), and gl33 for opengl 3.3, and nalgebra for linear algebra math with matrix projection. I'm having fun with this.
>>
>>102088126
>Tons of unsafe code
then whats the point of doing it in rust?
>>
>>102064622
>You can use inheritance in the same way as composition, using templates instead of virtuals, and then get all of the benefits of ECS without having to pass around references everywhere
I wish but unlike in ECS you can't redefine the inheritance hierarchy at runtime. Being able to mix and match components arbitrarily is my favourite part of ECS. That being said you can get that behaviour just using components (without the S)
>>
>>102088138
>then whats the point of doing it in rust?
because it's fun? Rust has other features that make it fun other than just memory safety. no exceptions, optional type instead of null, borrow checker, traits, macros.
>>
File: 1721516547639585.png (566 KB, 1080x1080)
566 KB
566 KB PNG
>>102088265
>the borrow checker is fun
>>
>>102088308
really? getting filtered by something as simple as the borrow checker? It's the easiest part of rust.
you guys really doing programming here or are you guys nocoder larpers?
>>
>>102088327
I mean if you're programming just to overcome arbitrary obstacles put there by the programming language and not you know, actually creating something, wouldn't that make you a "nocoder larper"?
>>
>>102086299
SVGs are analogous to meshes - convert it to a mesh
>>
>>102082024
OpenGL uses transposed matrices
>>
>>102088358
>I mean if you're programming just to overcome arbitrary obstacles put there by the programming language and not you know, actually creating something, wouldn't that make you a "nocoder larper"?
post your stuff then, I posted mine. I'm just starting to learn. But I posted progress.
If you really want to go the "create" route, where's your game huh, did you ship it? You built it in a language without arbitrary obstacles like the borrow checker, right?
Why so much seethe over some progress made by another?
>>
>>102088435
>ou built it in a language without arbitrary obstacles like the borrow checker, right?
yes i did
>>
>>102088441
cool, ship your game then. I'll still be posting progress, and if you want to seethe at my posts for using rust, do as you wish.
>>
>>102084584
Not him, and this might be a retarded question, but do you mean keeping ids/references to units in a grid, or to make the units actually stored in a grid like data structure?
>>
>>102084189
I found her from that thread. too bad she's using C++ and not C or something more sensible.
>>
>>102088265
>he thinks the borrow checker is fun
>he thinks exceptions arent opt out in other languages
>he thinks optionals dont exist in other languages
>he thinks traits arent just pussified interfaces
>he thinks macros are good
>>
>>102088489
That's actually a good question because it's not immediately obvious what the best way to store game objects in a spatial partition is, whether it be a grid or an octree or anything else
Each cell contains a group of objects in that cell, and objects move between cells. Each cell could contain a vector with the object itself, but then you'd waste time having to copy the objects between cells every time it moved. So each cell could contain a vector of pointers, but then you're still dealing with the fact that you're constantly expanding and contracting these vectors to accomodate the objects and not waste all your memory. The best way to do it is with an intrusive linked list, C style, the linked list is part of the object itself, no wasted time managing memory
>>
>>102088126
kek, fighting language this much. this reminds me of when I was starting with gamedev for Android, in pre-Unity era. I had to do object pooling to prevent Java GC from stalling the main loop. fucking nightmare. eventually, I discovered JNI and NDK, and rewritten the whole thing in C++.
>>
File: file.png (1.16 MB, 680x1069)
1.16 MB
1.16 MB PNG
>>102088126
>rust
>Tons of unsafe code.
>>
>>102088652
>>102088856
Seething negroids. Holy fuck I love rust. It makes nocoders, negroids and retards seethe in anger. I'll post more progress don't you worry folks.
>>
>>102088967
you will not ship. screencap it.
>>
>>102088967
dude you made a cube
>>
>>102089080
If it finally means someone makes a successor to Cube in a memory safe language, I'm all for it.

https://www.youtube.com/watch?v=4aGDCE6Nrz0
>>
File: the stat of rust.png (1.53 MB, 1920x1080)
1.53 MB
1.53 MB PNG
>>102088967
>>
>>102089132
>there are 5 games written in Rust
doubt
>>
>>102078257
>>102081276
I mean it is an imperative C API, with global state shenanigans. most programming in C++ make their own OOP wrappers
>>
>>102089051
Well what have you shipped then nigger?
>>102089080
more than you ever made through
>>102089132
Soon
>>
>>102089533
sorry, sweaty, not doxxing myself just to entertain some weak-minded retard who falls for meme langs
>>
>>102089594
So you don't have anything to show for it, gotcha
>>
File: whyyyyyy.jpg (228 KB, 1600x900)
228 KB
228 KB JPG
Why does unreal look like this?
Everything looked right until my hand slipped and moved some settings and even if I delete the file it looks like this, on my linux pc works fine but it looks like this on my windows lap
>>
>>102088586
So basically the objects are stored somewhere else, like in a flat array, but the ones in the same grid cell are chained together in a linked list? And the grid structure itself only has to keep the start of the linked list?
Wow, I would have never thought about doing it that way. That's pretty cool.
It does sound a bit easy to fuck up, since every time an object moves to another cell or gets deleted you'd have to manually fix up the linked list in addition to removing it from its array, and you can't really do that in a destructor or similar. I guess you just have to remember to do it.
>>
File: output.webm (1.08 MB, 1280x720)
1.08 MB
1.08 MB WEBM
I got object collision done. Now it's time to add object rotation.
>>
>>102081409
keeping life aside, there is a lot wrong with software development. C is and always will be the king. People with skill issues try and cope with Java, Rust, Zig, Odin and other modern langs. I tried most of them and I settled on Odin because it is the closest to C of them all with needful improvements and because of that, I can compromise if the language itself has a few downsides.

>>102082302
>from now on I won't touch Odin unless there's a change in leadership
that won't be happening so that's it, I guess. That is like asking Jon Blow to step down from Jai lol
>>
>>102090172
just use git and revert it
>>
>>102090487
noice!
>>
>>102077515
Troon lines.
>>
>>102083971
>>102083993
>>102084190
Can someone explain please?
>>
My dream game's story isn't developed enough.
Do you think it's a bad idea to start writing short stories of that world, to "sharpen my claws" on storymaking, if that makes any sense?
Vidya is a visual medium after all, the idea of boring the player with autistic details is a fear of mine.
I'd then choose the most interesting stories or characters, to have something a bit solid to work from.
inb4
>game
>story
I know, but I need to give context to player actions at the very least.
>>
>>102092863
Yeah man make sure to write 150 short stories before starting on your game. remember if you start dev'ing you've already lost.
>>
>>102092863
>>>/lit/
>>
>>102090455
>can't really do that in a destructor
why not, wouldn't the object still be alive during the scope of the destructor
>>
>>102092434
The copy is deferred until you specifically ask for it, otherwise that value is actually just a const ref, you are asking why not just make the copy implicitly as soon as you attempt to write modify the variable? Well if you did that then you would have to know how every line in the function works to know if you have a reference or a value.
>>
>>102088327
>filtered by something as simple as the borrow checker
>Tons of unsafe code
lol, lmao even
>>
>>102093053
why not make it clear syntax wise at the argument level?
>>
>>102093093
Because the caller shouldn't have to know or care or even be aware if the function is going to copy or take a const ref. It's just C++ derangement syndrome in my opinion, trying to make "everything better" instead of just sticking with what has worked.
>>
>>102093053
>you are asking why not just make the copy implicitly as soon as you attempt to write modify the variable?
No what I mean is, the compiler knows whether a param gets possibly modified within a function (i.e. somehere in code in some if statement there is "param = 1"). So if that's detected, the compiler can just automatically inject "param := param" at the top of the function to make a copy. All code below will then use the copy. It's transparant to the developer who now doesn't need to do a manual copy.
>>
>>102093174
what do you mean? it's good for the caller to know if the function mutates the passed argument or not, especially in the context of multi threading. also out parameters are backed into windows api at this point.
>>
>>102093183
>No what I mean is, the compiler knows whether a param gets possibly modified within a function (i.e. somehere in code in some if statement there is "param = 1"). So if that's detected, the compiler can just automatically inject "param := param" at the top of the function to make a copy. All code below will then use the copy. It's transparant to the developer who now doesn't need to do a manual copy.
Ok, now read the second sentence.
>>
>>102093217
Why does the caller care if the function makes a copy of a value then changes it?
>>
>>102092929
>>102092935
You're mean )=
>>
>>102093226
What's wrong about it? You wrote
>Well if you did that then you would have to know how every line in the function works to know if you have a reference or a value
No not if you take a copy at the top of the function automatically. The compiler then knows that it's a value! Just like if you manually write "param := param" at the top....
>>
>>102093342
Compiler knows but the programmer would have to compile the program to know
>>
>>102093394
I don't understand what you say. To the programmer it's a value in any case. Either mutable or immutable. Only the compiler knows about a ref being passed. Everything else is transparent to the programmer...
>>
>>102093217
const& != &
>>
>>102093439
So your thesis is that the programmer shouldn't need to know the size of the stack frame easily, just go apeshit and accidentally stack allocate that 10000 element array you passed in because who cares
>>
IT RETURNS A STRING NOW R U HAPPY
>>
>>102093500
But it would happen anyway if you manually did "param := param"??? If you don't mutate within the function, then there is no reason for the compiler to inject this automatically..
>>
Is it possible to have a first person camera that can rotate on all 3 axes and have no tilting (no roll when rotating on pitch/yaw)?
>>
>>102093616
So then you agree that in order for the programmer to know if something is a reference or a value they would have to read the entire function and understand every line of it even if somebody else wrote it.
>>
>>102093635
>rotate on 3 axis
>no tilt
>no roll
>rotate on pitch yaw
how many times can you contradict yourself in a single question
>>
>>102093635
just cap the pitch at 89 degrees so you dont get deadlock issues
>>
>>102093663
Okay thanks, that's a good point. I don't really have enough experience to judge the implications in real world and whether my approach would still be practical. Probably not, because in such low level languages you want to have control.
>>
>>102093063
>>filtered by something as simple as the borrow checker
>>Tons of unsafe code
unsafe doesn't even turn off the borrow checker you fucking retard
unsafe exists so that I can create safe wrappers over it.
You can cope all you want that your C++ doesn't have this feature. Keep on debugging segfaults for the umpteenth time.
I can guarantee my library written code cannot segfault unless it links to C/C++ which segfaults randomly for one reason or another
>>
>>102093616
>param := param
that's the most retarded syntax i've ever seen, and i've seen rust
>>
>>102093906
It's kind of like C++ lambda init capture
>>
>>102063444
Non-game dev here. I wrote a sim for a company project, and now want to add visuals. Should I start with Bevy? Or should I start at SDL and work up?
>>
>>102094016
Visuals eh? Do you guys have PowerPoint?
>>
>>102088233
You can't redefine ECS at runtime either, you can only choose from a set of predefined configurations. With a templated inheritance hiearchy you can accomplish the same thing by discriminating over a tagged union.
>>
>>102093776
>deadlock
you mean gimbal lock
>>
>>102094460
yea, that what I think anon was trying to solve
>>
>>102094107
Yes, but by visiuals I mean I want to be able to add in a UI that shows what's happening in the sim as it progresses. Essentially I have a bunch of nodes in a network between which widgets flow, and I want to show real time congestion as people set up and run scenarios.
>>
>>102094478
Just use quaternions instead.
>>
>>102094481
So it sounds like you want data visualization as opposed to a game engine. Something like Network chart with edge bundling?
>>
>>102093776
>>102093734
Ok, I made a little opengl demo
https://pst.moe/paste/fbcrhd
and a video
https://files.catbox.moe/z82db3.mp4

If I'm moving camera in circles, the cube starts rolling to the side.
The advice I found on the Internet was "rotate against local X axis and global Y axis". You can try commenting out line 120 in my code. This removes tilting but adds (probably gimbal lock, idk?) whenever I roll 90 degrees by myself (using wheel scroll).
>>
>>102094233
Have you tried inverting the polarity of the neutron flow in your flux capacitors?
>>
>>102094643
Yes. In a sense. That vis would work, but since there's a time component, it would be fun to layer that in. Plus I'd like to be able to click each node and have that bring up a viz of the actual site being simulated there so each node's intracongestion could be visualized. And also allow the user to add or remove or adjust labor/capital to see the effect on the node and network. Hence why I thought a game would work well for this.
>>
>>102094493
4d is too hard for the average gedger
>>
File: sadpepe.jpg (6 KB, 300x168)
6 KB
6 KB JPG
>having to recompile everything when you change a header
>>
    Camera()
{
this->Projection = glm::ortho(0.0f, 640.0f, 0.0f, 480.0f, -1.0f, 1.0f);
this->View =
glm::lookAt
(
glm::vec3(0,0,1),
glm::vec3(0,0,0),
glm::vec3(0,1,0)
);
this->Model = glm::mat4(1.0f);
this->MVP = Projection * View * Model;
}


how would i move the camera left and right? am i doing this right?
>>
>>102095033
define left and right? Do you mean pan the camera left and right? If so move the eye of your look at and the center.
>>
>>102095033
>glm::lookAt
Based on your arguments I'm assuming this takes
forward, position, and up vectors? I would just maintain those as variables and rebuild the view every time you move the camera.
>>
>>102095000
Just include everything in one file and have a unity build.
>>
>>102095033
how about you look at the code instead of copy pasting from a tutorial
>>
>>102094687
Okay I'm looking at it, you trolled the FUCK out of me though with these lines though
SDL_ShowCursor(0);
SDL_WarpMouseInWindow(window, ww / 2, wh / 2);
>>
>>102095069
>>102095253
                glm::vec3(0, 0, 1),       // Camera position in world-space
glm::vec3(0, 0, 0), // Camera eye looks at origin
glm::vec3(0, 1, 0) // Camera head is up


so i'm assuming a pan right would be

                glm::vec3(n+1, 0, 1),       // Camera position in world-space
glm::vec3(n+1, 0, 0), // Camera eye looks at origin
glm::vec3(n+1, 1, 0) // Camera head is up


?

i'm plugging the mvp into the shader to use

    gl_Position = mvp * vec4(position, 1.0);
>>
>>102095357
this isn't from a tutorial cuntfuck
>>
>>102095432
That doesn't look right to me. If you are saying the up vector is in worldspace then it should also have a z component of 1. It could be that the up vector is relative to the camera in which case you would leave it as 0,1,0
>>
Where should I start?

https://www.amazon.com/Game-Programming-Creating-Games-Design/dp/0134597206

Or

https://www.amazon.com/Hands-Rust-Effective-Learning-Development/dp/1680508164
>>
>>102090487
Good work.
>>
>>102095432
grigga what?
have a camera pos (glm::vec2), this is assuming your game is 2D since your UP vector is +Y and your eye is +Z looking to 0, 0, 0.
now add your camera pos to your eye and center.
So to move your camera left just decrease it's position x, and increase it for right.

ref: https://learnopengl.com/Getting-started/Camera
>>
>>102095033
If you just want to translate left or right in a first person style, simply shift the eye and target by the same amount.

Remember eye is where the camera is (like your eye ball) and the target is where you are looking. When you are first learning it helps to draw very basic sketches.
>>
>>102095357
chatgpt or stackoverflow doesnt count either
>>
File: shit left.png (91 KB, 1366x768)
91 KB
91 KB PNG
>>102095583
>>102095759
i've done it
>>
File: 1723978112209246.jpg (60 KB, 575x488)
60 KB
60 KB JPG
>>102095901
bless your heart
>>
>>102095901
>Up vector is (0,1,1)
Couldn't decide between y-up and z-up? Kek
>>
i'm done for today. see you later math nerds
>>
File: 1722945628848225.gif (3.13 MB, 386x280)
3.13 MB
3.13 MB GIF
>>102096016
>guy ask how to move cam
>doesn't it the strangest way
>post triangle
>doesn't elaborate
>leaves
I kneel, King
>>
>>102088520
>or something more sensible.
I don't think "sensible" is high up on a tranny's list of priorities.
>>
>>102095901
What theme and font are you using.
>>
>>102094687
like this?
https://pst.moe/paste/fghvwi
>>
>>102096083
post your non tranny progress
>>
>>102088520
>her
>>
>>102096211
Cool anon, thanks!
>>
>>102096211
sexy code
>>
>>102096949
no problem, still needs some work i didn't want to spend too much time on it but the main thing I noticed was you weren't inverting the view matrix which can make it hard to reason about what the camera is doing. It's easier to move the camera like an object in the world and then invert the matrix at the last step.
>>
>>102096135
Atelier Dune Dark
Zed Plex Mono
>>
>>102090487
So are these models or sprites?
>>
>>102097715
He switched to soulless 3d
>>
>>102095656
>game programming
>rust
that doesnt seem psychically possible!!
>>
>>102097715
I switched to soulful 3d
>>
>>102092434
I think it's just done so it's obvious the parameter is being copied
>>
>>102097791
This book suggests otherwise. Any downsides?
>>
>>102098047
> Any downsides?
Rust
>>
>>102098101
Does that cpp book look worthwhile?
>>
>>102095000
>still using makefile from an sdl2 tutorial that recompiles everything in one command each time because i don't know how to make it build and link seperate object files
>>
all this time i was scared of utf8 and localisation when sdl-ttf and harbuzz exist
>>
>>102098701
>sdl-ttf
Harfbuzz already depends on freetype. Just use that.
>>
>>102099089
sdl hands you a surface that you can just render to screen. i thought sound was the final boss but it was text, maybe i'll revise it later.
>>
>>102099223
Wait, people actually use SDL's rendering API?
It's so shit though.
>>
>>102099254
for 3d? maybe
for 2d? it's more than enough
>>
so what's the verdict on ecs?
>>
>>102099488
I have a phd in debating ECS on 4chan and these are my findings:
70% of people talking about ECS don't even understand what it is and have it confused with plain old composition and data-oriented design
25% of people talking about ECS are architecture astronauts who haven't actually made anything
5% of people are actually using it to make a game
>>
>>102099543
>5% of people are actually using it to make a game
>5%
>make a game
>ECS
holy copium
>>
>>102099585
I should say they're trying to make a game with it, I did say they have made a game or are succeeding in doing so
>>
>>102099543
What's the percentage of people who don't understand OOP and think ECS is a solution to some imaginary bogeyman of diamond inheritance chains 10 classes deep?
>>
>>102099609
I'm not sure if I've actually seen anyone claim ECS was the 'solution' to inheritance, but the initial proposition of ECS was it was the solution to the "death of a thousand cuts" scenario introduced by OOP and virtual method calls and the cost of indirection stacking up
>>
>>102099609
it doesn't change the fact that after OOP became a thing, the defacto way of learning programming at all was having tons of objects, it always start with animals/vehicles, it's always "use a virtual class" even when only one class inherites from it.
people naturally end up having 10 classes deep and getting an error because of diamond inheritance. or trying to make cyclic bullshit.
Java alone deserves a special place in hell for its autism with OOP, when even simple integers are objects you can inherit from.
people just see simple DoD as a breath of fresh air.
>>
>>102099660
>people just see simple DoD as a breath of fresh air.
Not really, the people who like DoD are all performance LARPers
The gigantic OOP inheritance chain boogeyman is some relic from the 90s where OOP was new and people didn't know how to use it yet
>>
File: 2158726763817.jpg (5 KB, 165x200)
5 KB
5 KB JPG
>durrr I can't decide whether my MusicalSword should inherit from BladedWeapon or from AudioDevice so I'll use ECS instead
>>
>>102099677
just look at things like Godot or your average C++ project. it's inheritance all the way down. not a single static function call because everything has to go through the vtable.
>>
>>102099742
>want to add a LightSword?
>whelp, time to inherit from LightSource
>>
>>102099764
Inheritance itself is not a problem. Even going through a vtable for most things is not a problem. The OOP boogeyman is abusing inheritance, with long inheritance chains and needless dependencies and merging of responsibilites, which was a problem a long time ago when people didn't know how to use OOP but is not today
>>
File: 05135.jpg (90 KB, 1190x659)
90 KB
90 KB JPG
actual screenshot from an ECS indoctrination video
>>
>>102099869
>Platypus - Bird
>>
>>102099972
beak = bird
>>
File: 1463660343479.png (152 KB, 1948x858)
152 KB
152 KB PNG
>>102099982
Should've added "beakable".



[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.