nigliazzo

hi there!

i'm new in game programming (begun 2 months ago) and, after having created the basis for a Turn-based strategy game i've encountered major problems in calculating line of sight and range of view for my characters. I've also had problem with a map editor then i've decided to move to XNA. Now i've more complicated problems :)

1: i've just created a 3D map editor. A 40x40 tile based map that i can modify. I can rise, lower and flatten my terrain but it requires a lot of times because i must redefine my vertexbuffer everytime i modify my map. Is there another way How can i send only my modified vertex information to the GPU

2) in my map, if a tile's inclination is > 45 degrees,another texture is assigned to that tile (rock texture instead of grass texture). Now i want to make a gradual change of textures between grass and rock textures. How can i do (without creating 1 thousand different textures)

3) I want to create a 2D interface on the side of the screen in which i can display my actual mouse-position, tile selected, characterselected and so on. I must define a "window" sprite and then draw it on my screen Can't I create a sort of form or maybe a 2D rectangle in which i write these info I also need buttons to switch between map editor and game because i need to test some algorithms (Astar i.e.)

Maybe i should have posted this on three different thread...
Sorry for my bad English (damn english teacher!)


Re: Game Technologies: General Creating a Menu in 3D, Modify Vertexes & Textures

Inaki Ayucar

1: i've just created a 3D map editor. A 40x40 tile based map that i can modify. I can rise, lower and flatten my terrain but it requires a lot of times because i must redefine my vertexbuffer everytime i modify my map. Is there another way How can i send only my modified vertex information to the GPU

How are you doing the refresh of data in the vertex buffer. That should not slow down your program.

2) in my map, if a tile's inclination is > 45 degrees,another texture is assigned to that tile (rock texture instead of grass texture). Now i want to make a gradual change of textures between grass and rock textures. How can i do (without creating 1 thousand different textures)

What you should do is creating a transition texture in Photoshop or something, which gradually goes from texture A to B, and fits seamless both with A and B in the extremes. Then, use a tile row or column to make the transition asigning this texture to the full row and creating the correct texture coordinates.

3) I want to create a 2D interface on the side of the screen in which i can display my actual mouse-position, tile selected, characterselected and so on. I must define a "window" sprite and then draw it on my screen Can't I create a sort of form or maybe a 2D rectangle in which i write these info I also need buttons to switch between map editor and game because i need to test some algorithms (Astar i.e.)

In Managed DirectX there are some helpers for writing text on screen and creating User Interfaces, like buttons, static texts, list boxes, etc. I havení»t seen that in XNA and doní»t know if it will be included in the future. Actually, user interfaces are intended to be done using textures for fonts, images, etc. What you can do in porting those MDX helpers to XNA or search the web if someone else already did it.






Re: Game Technologies: General Creating a Menu in 3D, Modify Vertexes & Textures

nigliazzo

I was recalculating 1 billion rays at every update. Problem solved : P

I was thinking to something more functional like doing this transition in my engine. If i do this in photoshop and i have 4 types of tiles, i must paint 8 * 4! different tiles (8 for every transition)

DRAW STRING ON SCREEN
Found a couple of tutorial and a library. For all who read this post:

http://www.alanphipps.com/VisualBasicdotNET-XNA-DisplayText.html
In this tutorial they explain how to draw string on screen

http://jsedlak.org/Xna5D
This is a library that can help drawing buttons, labels, windows and text on screen