Dear returning Carmageddon fans Image

These last years, the CWA Board assimilated what was archived from many old Carmageddon forums, including the whole of the Official Carmageddon.com Forums.
If you wish to merge any previous account you might have had with your new or existing CWA account, don't hesitate to reach out to us !

Blocksburg

The greatest unfinished sequel ever!
User avatar
Harmalarm
road raged psycho
Posts: 1302
Joined: Tue May 13, 2008 3:56 am
Location: Den Haag, Holland
Contact:

Re: Modular modeling (level design)

Post by Harmalarm »

I noticed the same thing on opening in Plaything2. I just clicked the 'cancel' button until the file opened.

I would have to take a look at the max file in combination with the exported files to tell where the 'subname' material comes from. To be honest, I am pretty sure it is a typo in my script, as i remember having used the name 'subname' somewhere in the material exporting part.

so again; --> added to my to-do list

Tags:
User avatar
C2 Scientist
jaywalker
Posts: 2059
Joined: Tue Mar 26, 2002 5:00 pm
Location: Finland
Contact:

Re: Modular modeling (level design)

Post by C2 Scientist »

In this update the .max file has been cleaned of extra materials, if you want to try exporting it.

https://c2s.cwaboard.co.uk/DLoads/MaxBlocks.zip

You should see Plaything repeatedly asking for the 'subname' material, no matter how long you press the ESC key.
User avatar
Harmalarm
road raged psycho
Posts: 1302
Joined: Tue May 13, 2008 3:56 am
Location: Den Haag, Holland
Contact:

Re: Modular modeling (level design)

Post by Harmalarm »

try clicking the cancel button instead of pressing escape, it will ignore the missing material but will continue loading. Pressing escape has the same effect as closing the dialog, which will cause it to keep coming back. (I think it was about 30 clicks till the material showed up)

I haven't had the time to look at the new models/script yet. Maybe this weekend I can spend some good hours on it. :)
User avatar
C2 Scientist
jaywalker
Posts: 2059
Joined: Tue Mar 26, 2002 5:00 pm
Location: Finland
Contact:

Re: Modular modeling (level design)

Post by C2 Scientist »

Yes, the slightly older version opened with ~ 30 clicks, but this new version does not, even by pressing the cancel button instead of escape.

No new models in this pack by the way, just the material cleanup. :)

I think there is still room for some materials cleanup, combining and organization, since some 'invisible' materials (not yet added to the material editor) are still present in some of the imported objects. This may be causing duplicate materials, unless I'm mistaken.
User avatar
Harmalarm
road raged psycho
Posts: 1302
Joined: Tue May 13, 2008 3:56 am
Location: Den Haag, Holland
Contact:

Re: Modular modeling (level design)

Post by Harmalarm »

Found the culprit; a misnumber in the multisub...

Image

See that 13, and the 15 below? You should be really careful with this, as fiddling with this can really fuck up your applied materials id order... anyway, it is part of your file, on a number of multisubs...

to fix it now, check all your multisubs with missing numbers. Add the missing numbers as extra submaterials, e.g. add a submaterial and change the number in front of it to the missing numbers. Re-export and all should be good...

If it can happen to you it can happen to others, so I will need to build something around it. --> added

btw, exporting takes looooooooong on my laptop. Is it fast on your system?

edit: the material on the electric pilon is pretty oddly messed up too.
edit2: I am still having trouble exporting it properly... I guess this is a bigger problem than it first seemed. I think I will have to do some re-writing on the dat part aswell... (like you said, optimize the way the materials are being exported along with the mesh)
Last edited by Harmalarm on Thu Mar 22, 2012 7:27 pm, edited 1 time in total.
User avatar
C2 Scientist
jaywalker
Posts: 2059
Joined: Tue Mar 26, 2002 5:00 pm
Location: Finland
Contact:

Re: Modular modeling (level design)

Post by C2 Scientist »

Yeah, the multimaterial cleaning utility does that. I was already aware of the skipped IDs in the multimaterial(s), but it didn't cross my mind that it could be causing the problem in Plaything. I'll try fixing it and see if anything blows up. :)

Exporting the track takes ~ 6 seconds on my desktop PC (Athlon 64 2800+, 2GB RAM).
User avatar
Harmalarm
road raged psycho
Posts: 1302
Joined: Tue May 13, 2008 3:56 am
Location: Den Haag, Holland
Contact:

Re: Modular modeling (level design)

Post by Harmalarm »

never mind about the exporting speed, It takes about 8 seconds here... Max was being crazy.

Thanks for providing this scene by the way, as it again shows me some minor glitches in the script.

btw, I did some nice optimization in the dat file regarding the materials already ;) Now all I need to do is slim down the Mat file. The subname error is also resolved.
User avatar
C2 Scientist
jaywalker
Posts: 2059
Joined: Tue Mar 26, 2002 5:00 pm
Location: Finland
Contact:

Re: Modular modeling (level design)

Post by C2 Scientist »

Good to hear. :)

Here's also a minor update again:

https://c2s.cwaboard.co.uk/DLoads/MaxBlocks.zip

Nothing hugely important here, but there are a few changes:

- Filled the gaps in submaterial IDs
- Auto-retriangulated majority of the blocks (probably doesn't affect performance though)
- Texture improvements: size reduction, combination, desaturation/contrast/etc
- The electric pylons now have 3D wires
- New noncar: chain link fence

Fences made from adjacent noncars? Yay or nay? :)
User avatar
Harmalarm
road raged psycho
Posts: 1302
Joined: Tue May 13, 2008 3:56 am
Location: Den Haag, Holland
Contact:

Re: Modular modeling (level design)

Post by Harmalarm »

I haven't had a chance at all yet to look at the new models. I hope to have some time tonight ;)
User avatar
C2 Scientist
jaywalker
Posts: 2059
Joined: Tue Mar 26, 2002 5:00 pm
Location: Finland
Contact:

Re: Modular modeling (level design)

Post by C2 Scientist »

There aren't many new models yet, I've been a bit busy with other things. :)

As for the numerous small objects causing slowdown... I think that at least the irregular shaped grass and asphalt areas could be combined into single continuous meshes. It probably doesn't hurt to do even more combining after that.

That's not to say that I would permanently delete any blocks from the tileset (which lies outside the play area).

By the way, just to confirm: when you said you've resolved the 'subname' issue, does that mean that gaps in material IDs are now ok?
User avatar
Harmalarm
road raged psycho
Posts: 1302
Joined: Tue May 13, 2008 3:56 am
Location: Den Haag, Holland
Contact:

Re: Modular modeling (level design)

Post by Harmalarm »

yes, gaps in the multi-submaterial id's are accepted now. Still, I would advise you to be cautious with this. I will upload the new scriptpack once the car-pack is operational.

The new model exported fine after removing the shapes, ungrouping and detaching all links.

I will work on the linked object tonight, and hopefully add support for groups back into the script. It can be really handy for organizing the map's hierarchy.

I will have to set a maximum limit for object linking levels. 4 is probably a deep enough hierarchy level to work with, e.g. I will make it so you can have 4 levels of children for a given object. (object, clild1, child1.1, child1.1.1, child1.1.1.1)
User avatar
C2 Scientist
jaywalker
Posts: 2059
Joined: Tue Mar 26, 2002 5:00 pm
Location: Finland
Contact:

Re: Modular modeling (level design)

Post by C2 Scientist »

Some fixes, a few new models, and a gas station WIP. :)

https://c2s.cwaboard.co.uk/DLoads/MaxBlocks.zip

Though something is wrong with the smaller fuel island canopy: some of the triangles are a bit messed up. I've tried resetting Xform, converting between mesh and poly, and attaching to a freshly made box, but the problem persists. Odd.

I've now combined some of the larger surfaces of single materials into bigger continuous meshes. While modeling those using the line tool, I noticed that it would be useful to keep them editable, instead of simplifying them into editable polies. But if kept editable, then they won't export well (you can see this for yourself, I've left the large gas station asphalt and grass areas editable).

So for the export, what do you think about something like this:

A) if a "shape" object has a certain character prefix, convert it into an editable poly
B) ignore (don't export) any other shape objects
User avatar
Toshiba-3
BRender Actor
Posts: 5510
Joined: Sun Jun 08, 2003 12:14 am
Location: MagnaChem Data Unit
Contact:

Re: Modular modeling (level design)

Post by Toshiba-3 »

Tested your progression here.
Technically it's quite impressive how structured it actually is.
But the performance is poor for such a /little/ environment. The technique is interesting but must probably be applied on bigger chunks and thus isn't that fit for outdoor areas designing. I still have to come up with something to illustrate my ideas.

Ingame i often fall through the ground after hitting elements like the parked car or the fuel pumps in the station.

All in all I have the feeling that building optimised environments for C2 is very different than for other games. Probably because of the engine's age but especially because of its limitations and what it actually expects to load, i.e. not scenes made with modern engines in mind :(

A simple example is elements sharing the same texture for their maps. It is good for small to medium objects or car components because the pixel density allows for enough visual details on 256* textures. But when it comes to environmental props, the 256 limitation quickly becomes annoying. Even though I'm sure that resources sharing has a very positive impact on the C2 engine, without being able to use textures ala 1024 the level design could really suffer from being forced toward that way.

About the pylons and their wires, have you tried the wireframe mode?

The fence reacted nicely by the way. Not sure it's a gain over smash performance though (and using too much of them might accelerate the noncar freezing I guess).
Image / carmageddon add-ons at road reaction
User avatar
C2 Scientist
jaywalker
Posts: 2059
Joined: Tue Mar 26, 2002 5:00 pm
Location: Finland
Contact:

Re: Modular modeling (level design)

Post by C2 Scientist »

I agree that performance-wise, it's not very effective. If I've understood correctly:

- If drawcall capped, reduce number of meshes by merging them together, or upgrade your CPU
- If fill rate capped, reduce texture complexity (resolution, get rid of alphas)
- If transform capped, reduce vertices (and vertex splits)

How many of the various optimizing rules apply to Brender engine, is something I've sometimes wondered myself. Anyway, I will continue to create more complex blocks from merged simple blocks, to see if doing that alleviates the performance issues. As the scene expands, it gets easier to identify repeating map elements, which could be merged into single meshes.

At some point, I may find myself merging quite large elements into single meshes, such as entire road junctions (of various types). :)

Oh, and what was the model slots cap again? Yikes.

About the issue of falling through ground when hitting objects: I'm fairly sure that this is caused by the presence of high number of vertices in a small area, which interferes with the collision calculations. It's a separate issue from falling through scaled objects. The object doesn't have to be hugely detailed for this to happen... but if said objects were noncars, even a high detail level wouldn't be a problem because of the simplified collision meshes.

Another kind of a collision issue with non-interactive map objects are very thin elements, e.g. street sign poles: your vehicle may pass through such thin elements. If I recall, in the past I worked around this kind of a problem by making thicker, invisible models for very thin elements, so that the collision would work properly. Then I made the actual, visible models childs of the invisible meshes, which made the visible models lose their ability to cause collisions.
User avatar
Toshiba-3
BRender Actor
Posts: 5510
Joined: Sun Jun 08, 2003 12:14 am
Location: MagnaChem Data Unit
Contact:

Re: Modular modeling (level design)

Post by Toshiba-3 »

I agree with your three rules, and I have the feeling you wrote them in the order of importance.

So yes, using modular track modeling for C2 would lead to simpler level designs made out of bigger chunks repeated now and then.
It reminds me of old city building sim games and the likes.

About the model slots cap, I guess it should be something like 1000 as using a higher matrix than 30x30 when preprocessing tends to make the game shout an error. That should be easy to test thanks to Harm's script.
Image / carmageddon add-ons at road reaction
User avatar
C2 Scientist
jaywalker
Posts: 2059
Joined: Tue Mar 26, 2002 5:00 pm
Location: Finland
Contact:

Re: Modular modeling (level design)

Post by C2 Scientist »

Newest version was posted here.

I've been thinking about making a small tool palette, which could speed things up slightly:

Image

I'll explain. :P

- The "X+", "X-", "Y+"... buttons would move the selected object into different directions
- The amount of movement would depend on the button depressed on the right, eg. 512 (these may have to changed into the radio/dot buttons, if the regular buttons cannot stay depressed)
- The "90" and "180" buttons would be for rotation, although the "rotate clockwise" shortcut already in Max reduces the usefulness of these two
- "Clone object to..." would first wait for the mouse to be clicked on a grid, then create an instanced copy of the selected object, and position it where the mouse was clicked (by the pivot). I was also thinking that this mode could stay active for the selected object until cancelled in some way, making it a fast way to place multiple street props. With my poor scripting skills, this might be too difficult for me to accomplish on my own, though. :P
- "Integer rotation": sometimes, despite using the "snap to grid" feature, some moved objects still end up in positions like "1024,335". This button would take the said position, and round it to "1024,000", for the selected object(s).

The code for the (currently completely unfunctional) UI is here. Any help/thoughts/suggestions are always appreciated. :)
User avatar
Harmalarm
road raged psycho
Posts: 1302
Joined: Tue May 13, 2008 3:56 am
Location: Den Haag, Holland
Contact:

Re: Modular modeling (level design)

Post by Harmalarm »

Ah yes, quite useful for your modular design props, and cool to see I am not the only one digging in maxscript! :D

The buttons 1, 8, 64, 512, 4096 represent distances? Wouldn't you need more buttons within the power of 2? Say 1, 2, 4, 8, 16, 32, 64, 128, 256, etc? Combining these, e.g. pressing a combination, you can get any integer number you want.

What if you use the 'clone object to' in combination with the distances and the axis buttons, instead of pinpointing a position with the mouse? That way your objects will always stay on your grid.

Curious to see your progress on this!
User avatar
C2 Scientist
jaywalker
Posts: 2059
Joined: Tue Mar 26, 2002 5:00 pm
Location: Finland
Contact:

Re: Modular modeling (level design)

Post by C2 Scientist »

I thought the palette would stay more compact with fewer buttons, but perhaps a few more in between wouldn't hurt (1,4,16,64,256,1024,4096). :)

My plan was that the mouse pinpoint function would also obey the current snap setting, so the objects should fall into grid when using grid snap.

Cloning objects at regular intervals is already doable with array, shift+dragging and spacing tool. ;)

I forgot to mention about a problem that slightly annoys me. Maybe it's because I've customized the units I work with. Often when I manually enter e.g. "1024" as object's position, it ends up as "1023,999....". There's a related option in the prefences (decimals), but in some cases even that doesn't fix the problem.
User avatar
Harmalarm
road raged psycho
Posts: 1302
Joined: Tue May 13, 2008 3:56 am
Location: Den Haag, Holland
Contact:

Re: Modular modeling (level design)

Post by Harmalarm »

in fact, the unit roundoff is linked to the systems unit settings e.g. the units windows uses.

you can change the number of digits after the decimal in the 'region and languages' additional settings dialog of windows 7. Not sure where you can do it on other windows versions.

if you change it to, say 2 units, max will show a different roundoff
User avatar
C2 Scientist
jaywalker
Posts: 2059
Joined: Tue Mar 26, 2002 5:00 pm
Location: Finland
Contact:

Re: Modular modeling (level design)

Post by C2 Scientist »

I was thinking of uploading an updated version, but then I suddenly started getting a "NULL_POINTER_BEING _FREED" error in C2. I thought I had this before, but couldn't find any discussion about it in this thread.
User avatar
Harmalarm
road raged psycho
Posts: 1302
Joined: Tue May 13, 2008 3:56 am
Location: Den Haag, Holland
Contact:

Re: Modular modeling (level design)

Post by Harmalarm »

I was thinking of uploading an updated version, but then I suddenly started getting a "NULL_POINTER_BEING _FREED" error in C2. I thought I had this before, but couldn't find any discussion about it in this thread.
I suggest to first edit your text file to a minimum, to see whether the error is within the text file or the data files. It could be another one of those round-off errors that still needs fixing.

The error message sounds vaguely familiar but I can't put my finger on it!
User avatar
C2 Scientist
jaywalker
Posts: 2059
Joined: Tue Mar 26, 2002 5:00 pm
Location: Finland
Contact:

Re: Modular modeling (level design)

Post by C2 Scientist »

I'm fairly sure it's not the textfile, as I didn't change anything in it recently. I had a look at it but couldn't see anything strange.

Despite the error message, I'm going to update the ZIP-file... perhaps someone will beat me finding the cause of the error. :) Unfortunately the C2 files are not currently functional.

https://c2s.cwaboard.co.uk/DLoads/MaxBlocks.zip

(Extract to Races/Blocksburg)

I'm just hoping I haven't silently reached some sort of a limit in C2. :/
User avatar
Harmalarm
road raged psycho
Posts: 1302
Joined: Tue May 13, 2008 3:56 am
Location: Den Haag, Holland
Contact:

Re: Modular modeling (level design)

Post by Harmalarm »

I still haven't found any time to take a good look at things. Hopefully this week will give some windows of opportunity to check it out. (just so you know I haven't forgotten)
User avatar
Harmalarm
road raged psycho
Posts: 1302
Joined: Tue May 13, 2008 3:56 am
Location: Den Haag, Holland
Contact:

Re: Modular modeling (level design)

Post by Harmalarm »

Finally found the culprit:

&GrassHighrise02_00

an object with modifiers, but no actual final vertices or faces. The script overlooked it, thinking it could export it and so the game (and plaything) errored and crashed...
After removing it, I could export and play just fine.

I will add this to the checklist ;)

oh yeah, another thing I noticed was that you had a couple of 16 bit tiffs. Both game and c2 can load it, but the colors are all scrambled, so you better stick to 8 bit. (I believe it was the grass and bus texture)
User avatar
C2 Scientist
jaywalker
Posts: 2059
Joined: Tue Mar 26, 2002 5:00 pm
Location: Finland
Contact:

Re: Modular modeling (level design)

Post by C2 Scientist »

Thanks Harm, that was my mistake, but I'm glad it's still working. :)

I've uploaded a fixed version now, including the textures. I'm aware of the 16 bits causing false colors and other artifacts and I usually convert them to 8 bits as soon as I see a problem in-game, but this time the track wouldn't load. :)

The map image has also been updated and rotated 90° to better fill the map screen. Thanks to Tosh for mentioning the possibility in the C2 facts thread!

https://c2s.cwaboard.co.uk/DLoads/MaxBlocks.zip
User avatar
Toshiba-3
BRender Actor
Posts: 5510
Joined: Sun Jun 08, 2003 12:14 am
Location: MagnaChem Data Unit
Contact:

Re: Modular modeling (level design)

Post by Toshiba-3 »

I feel like this test map might become a monster? It's looking good really.
BTW I tested the map with dgVoodoo this time and it ran very well.

Image
Image / carmageddon add-ons at road reaction
User avatar
C2 Scientist
jaywalker
Posts: 2059
Joined: Tue Mar 26, 2002 5:00 pm
Location: Finland
Contact:

Re: Modular modeling (level design)

Post by C2 Scientist »

Thanks. :)

Does it run better with DgVoodoo than NGlide/ZSack? I'm currently using ZSack and the performance admittably isn't really stellar... perhaps I'll do a quick comparison.
User avatar
C2 Scientist
jaywalker
Posts: 2059
Joined: Tue Mar 26, 2002 5:00 pm
Location: Finland
Contact:

Re: Modular modeling (level design)

Post by C2 Scientist »

I'll post the most recent version before I leave for a short vacation:

https://c2s.cwaboard.co.uk/DLoads/MaxBlocks.zip

I changed the two coloured stripes in the canopy model, from two coloured materials to a single bitmap, which seems to have fixed the messed up polygons for some reason. I also made it a heavy noncar, but currently it seems to often fall through the ground when it snaps off. The bboxes should be ok, though.

Some fixes, additions, and other things as well. :)

There are two cases where a model is slightly mispositioned in-game, leaving a gap, and the traffic lights are missing the light plane in-game again. I'll have to fix those when I come back.
User avatar
Harmalarm
road raged psycho
Posts: 1302
Joined: Tue May 13, 2008 3:56 am
Location: Den Haag, Holland
Contact:

Re: Modular modeling (level design)

Post by Harmalarm »

Well I just gave it a go. You keep on expanding mister! Nice work. I do have to set my yon to about 50 to get a nice frame-rate though. Anything above make the game run sluggish on my laptop. Still, the map loading time is amazing isn't it? All thanks to the instanced objects :) A definite proof of concept.

I am currently re-writing a big portion of the exporter script, mainly aiming to get pre-processed tracks working. Your track still proves a great test model to get all the faults out of my script. ;) Thanks again.
User avatar
C2 Scientist
jaywalker
Posts: 2059
Joined: Tue Mar 26, 2002 5:00 pm
Location: Finland
Contact:

Re: Modular modeling (level design)

Post by C2 Scientist »

Well even bigger thanks to you for writing and constantly improving the script - it's a real pleasure to use. :)

Another new version:
https://c2s.cwaboard.co.uk/DLoads/MaxBlocks.zip

Some more noncar decorations in here, and since the number of them is about to reach 20, I've cleaned them up into their own subdirectory. I've added new signs with various sub-objects, which are using the hierarchy linking. There is also a new toy to play with. :)

As for bug fixes, the traffic light colours are visible again. But full-lit textures still aren't working, even though all of them are combined into a collectable powerup model. I swear I had this working at some point. :/
User avatar
Harmalarm
road raged psycho
Posts: 1302
Joined: Tue May 13, 2008 3:56 am
Location: Den Haag, Holland
Contact:

Re: Modular modeling (level design)

Post by Harmalarm »

Hah, nice update. I like the toy very much! ;)
User avatar
Toshiba-3
BRender Actor
Posts: 5510
Joined: Sun Jun 08, 2003 12:14 am
Location: MagnaChem Data Unit
Contact:

Re: Modular modeling (level design)

Post by Toshiba-3 »

C2S, about that problem with the FULLLITSYSTEM, have you tried preprocessing the track? I tried here but PT2 crashes :/ Come on Harm, we need direct preprocessing from 3DSMAX! :B

What's that Blocksburg textures.txt file? Filtering override for voodoo.txt?
Image / carmageddon add-ons at road reaction
User avatar
C2 Scientist
jaywalker
Posts: 2059
Joined: Tue Mar 26, 2002 5:00 pm
Location: Finland
Contact:

Re: Modular modeling (level design)

Post by C2 Scientist »

Yes, that's what it's for. :) It gets a bit 'shimmery' without any mipmapping at all, although I haven't tried if antialiasing would help it much.

As for the problem with full lit textures, I haven't tried preprocessing, but I recall they previously worked without having to do that as well. At one point I changed the ambient/diffuse color from ~80% brightness to 100% brightness in Max, to improve the visibility, but this has been already done so the problem must be elsewhere...
User avatar
C2 Scientist
jaywalker
Posts: 2059
Joined: Tue Mar 26, 2002 5:00 pm
Location: Finland
Contact:

Re: Modular modeling (level design)

Post by C2 Scientist »

I noticed that the idea of instanced objects could have an application in my round arena map as well (which is now updated).

Instead of having the whole arena in a single object, I used a 45° slice, cloned and rotated 7 times to form a full circle. Should be more optimized now. :)

You could go further than that, but it's the texturing in some parts that starts to look odd with too thin slices.
User avatar
C2 Scientist
jaywalker
Posts: 2059
Joined: Tue Mar 26, 2002 5:00 pm
Location: Finland
Contact:

Re: Modular modeling (level design)

Post by C2 Scientist »

It's been a while, sorry about that! Here's a new version again, although there may not be as much progress as you might expect from the long delay.

https://c2s.cwaboard.co.uk/DLoads/MaxBlocks.zip

Some of the changes include improved tree visuals, a new river in the north (including a glass tunnel that passes under it), and the beginnings of a new area in the west.

Harm: I've changed the electric pylons in that they have been split into several distinct objects that are grouped together (so each pylon is a group now). They don't seem to export properly, until I manually ungroup the groups. The up-to-date .max file is of course included if you want to make your own tests with this. :)

There are no such problems when exporting the other grouped objects, though.
Post Reply

Check who’s online

Users browsing this forum: No registered users and 10 guests