Advertisement Jump to content
Sign in to follow this  

Which way to setup my D3Dvertexbuffer?

This topic is 5058 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Hey, As you can see, my first post :) ... Don't know if I'm supposed to introduce myself but I think it's a nice gesture to you guys[/girls?], so here it goes... My name is Ad Steyvers, I'm 24, live in The Netherlands and since the start of February I work at a game-company called Zylom [online games]. But I'm already busy for quit some time [5 years with breaks of sometimes a whole year :S ] in gamedevelopment in my sparetime. The situation: Anyway, in sparetime I'm busy on this Diablo-sort of game, more RPG-oriented, turn-based and all kinds of neat features [at least I have in mind]. Now I already made half a 3D-engine in C++, but by poor coding by me, it was one big memoryleak, like a fucked up memorystack and all that crap :) ... So now I'm redoing the whole engine in C#, and optimizizing a big deal of it. Now my problem: I have this tile-based map and I use a nice Line-Of-Sight-algoritm to check which tiles are visible from the player's character viewpoint and which aren't. Since I'm creating the whole game in Direct3D and need to keep the engine fast, I want to use as few vertices as possible. In my old engine I used at least 4 vertices, up to max 8 vertices per tile [4 for an open tile, 8 for a tile with 3 walls]. Since I'm doing all kinds of optimization-things while creating the new engine, I want to implement a fast vertex-storing algoritm. If the field of visible-tiles would always be a rectangle things would be a lot easier, but since I really want to use this Line-Of-Sight-algoritm, the visible tiles could look like this: [] = visible tile <> = player [][][] []<>[][][][][][][][] [][][][][][] [][][][][] [][][][][][] [][][][][][] or   [] <>[][][][] [] [] The question: Has anybody any idea about how I could best store the vertices? Ofcourse using a vertex- and an indexbuffer, but since I'm into optimizng so much lately :) I think it should be possible using a trianglelist to render the above the visible tiles as fast as possible? Or am I incorrect? Pffff, quite a post... I hope I've been clear on what the problem is, please let me know if something is unclear. Thanks in advance for the help!

Share this post

Link to post
Share on other sites
Sign in to follow this  

  • Advertisement

Important Information

By using, you agree to our community Guidelines, Terms of Use, and Privacy Policy. is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!