🎉 Celebrating 25 Years of GameDev.net! 🎉

Not many can claim 25 years on the Internet! Join us in celebrating this milestone. Learn more about our history, and thank you for being a part of our community!

Fog of War / New ideas

Published August 21, 2006
Advertisement
* Fog of War
I've just finished integrating the new fog of war effect, it prevents you from seeing parts of the city unless you have a gangster/building in the area.
Before I was coloring the buildings on a per-model basis, it looked bad.

This method works on a per-vertex basis, inside the shader I determine the vertices' global position, and use that as coordinates into the global fog of war texture...which is update every frame using D3DXFillTexture *shudders* (it's just a 128x128 texture).

Because the D3DXFillTexture method is horribly slow, I rotate between 3 fog of war textures. The idea being that I'll always be performing the *slow* lock/fill on a texture which is not in-use by the video hardware. It seems to produce a nice speed up...can anybody verify that this process would actually speed things up?

It looks awesome in motion, these screenshots don't do it justice...to see things fading in-out in realtime looks a lot better...I was going to post a movie...maybe next update ;-)

I think it goes nicely with the bloom effect.


Yup.


The area around buildings under your control is visible at all times.


* Integrated in-game City browser/downloader
I'm working on the in-game city browser where you can select the city you'd like to play in [online or offline].

What do you guys think if I added the ability to select from 100s [potentially] of user created cities in-game, scrolling through preview images of each cities' layout. The list/preview images would be downloaded in real time, all in-game.

You could nominate maps in multiplayer, selecting from the entire online database, and then people could vote for the nominated map, and the map would be downloaded to each persons computer from the database. Also a simple rating/naming system would be used.

There would be a way to upload cities that you've created inside the city editor, by just pressing a button. I'm still kicking around ideas, but if it was that easy/user friendly to download new cities, people would be a lot more inspired to spend time making them.

If I get inspired enough I'll have this integrated in some form in the next few days, until then it's just an idea. Though technically I'm sure I can do all of this pretty easily...I'm still debating some finer details of how it will actually work internally, before I implement it.


* Strategic View
Up until now I've been limiting the height the user can raise the camera to, in the 'Commander mode'/'Strategy mode' [whatever you want to call it, I should probably decide :-)] Now what happens, is the city flattens [I'm still working on a cool blend sequence] and the camera pulls up showing the entire city, basicly in the form of a 3D mini-map. This will allow you to get a overall view of the city...in realtime. The 2D representation is so close to the 3D representation...I can perform all picking operations/etc on the 3D world, based on input from the 2D version, so it overlays pretty well. It's still a big work in progress though, I'm going to need to make new icons and a new UI for this part.

Playing around with the 'Strategic View', basicly a 3d version of the mini-map. Here, I'm using it to debug the vehicle AI.
(Click for bigger version)


I'm working on so many things right now, I need to post updates more frequently otherwise I'll leave some things off the list :-) Alright back to work [on the traffic AI]. Should have another update soon.

- Dan
0 likes 7 comments

Comments

ildave1
Quote: What do you guys think if I added the ability to select from 100s [potentially] of user created cities in-game, scrolling through preview images of each cities' layout. The list/preview images would be downloaded in real time, all in-game.


Sounds like a great idea. You've just got to make sure the list is updated with the favorite maps to differentiate the good from the bad. I know I don't want to click through 100 maps just to play map 95 to find out that it really sucks.

The fog looks great and I must agree that you need to update this journal more often. ;)
August 21, 2006 07:08 PM
dgreen02
Hey Dave. Yup I hear you on that...one of the core ideas would also be the implementation of a easy to use rating system (1-5 stars). You could sort user created maps by their rating. Also since you'd be judging the maps on their mini-map preview, it'd be pretty easy to see which maps look unique/fun/quality. This could be very cool...I'm going to keep thinking about it...

I'm trying to decide how much I want to involve myself in this process...the maps are VERY small so just letting anybody upload whatever map they want [as long as it has a unique name] should be fine...coupled with the rating system.

- Dan
August 21, 2006 07:13 PM
ildave1
Aye, having a large image of the play map with user ratings would be great. It would definitely add an element of diversity, for those people that love to 'build', gather friends, and play. Overall, it's an additional option for the players to choose to do.
August 21, 2006 08:00 PM
Iced_Eagle
So if you are onfoot, you still can only see so far down the street? I sort of would miss seeing all the way down a street and watching all the "bustle and hustle" of the city...

Anyways looking great otherwise :)
August 21, 2006 10:54 PM
dgreen02
Oh yea...Fog of war does not apply if you're controlling a gangster. Forgot to mention that one.

- Dan
August 21, 2006 11:07 PM
jollyjeffers
Woah, thats looking seriously nice [grin]

Your idea about the 3 textures and modifying them accordingly is a valid strategy. More generally referred to as a "ring buffer" or "bounded buffer" approach - Discussed in the DirectX Forum FAQ..

Although, if performance becomes a problem I'd go for manually implementing D3DXFillTexture(). The D3DX code is nice and convenient, but if you're doing the same thing over-and-over then your manually written code will have LOTS of opportunities for micro-optimization. Hell, even swapping it out for a lock();memcpy_s();unlock(); pattern would probably be faster..

hth
Jack
August 22, 2006 10:16 AM
Iced_Eagle
Quote: Original post by dgreen02
Oh yea...Fog of war does not apply if you're controlling a gangster. Forgot to mention that one.

- Dan


Woot! :D



August 23, 2006 06:17 PM
You must log in to join the conversation.
Don't have a GameDev.net account? Sign up!
Advertisement