11 hours ago, Afonso Matos said:
Let's say I have a big object that doesn't fit inside a chunk or that it is spawned in the frontier of a chunk. How would you go about generating the whole thing using the nearby chunks? With terrain it's pretty easy because the terrain is not hardcoded, so the algorithm is entirely free. But when I want to place hardcoded objects like castles or trees, I can't just cut the castle in half - or can I?
If I understand the question correctly, you are asking not about placement, but about what to do with objects on a boundary that are referenced by 2 or more adjacent 'chunks' of landscape, to avoid drawing them twice? Usually this is simple, you might have an ID for the castle, castle 10, and when you batch up objects to draw you detect if you are trying to draw castle 10 more than once, and only add one entry to the draw list.
Conceptually this would, say if you had 100 castles on the entire map, have a bitfield with 100 bits, clear them all, then set bit 10 the first time you add castle 10 to drawlist. Second time you come to it, the bit is already set, so do not add. The actual approach you take would be dependent on your particular situation though, this may not be appropriate.
You *could* split the castles up as you say, but then in the naive case you'd probably have to store all the data for which bits to draw somewhere, which would probably not be worth it. You could save a splitting plane with the object, but this probably would get complex in objects on 3 or more boundaries, and slow at runtime, depending on your implementation. In general I personally would not use that approach, unless there was some compelling reason.