Jump to content

  • Log In with Google      Sign In   
  • Create Account

Triad_prague

Member Since 06 Apr 2010
Offline Last Active Dec 09 2013 07:13 PM

Topics I've Started

structuring game code

05 December 2013 - 08:51 PM

Hi guys, I'm having a self doubt right now. But first, let me tell you the cause. It's the way I structure my game code. Specifically it's how I put my variables. Basically I have a source code for each module (gfx, sound, input, log). Thing is, I put each variable in their specific .cpp files:

 

for example, I put screen attributes (and any screen related function definition) in gfx.cpp

 

//in gfx.cpp

int screen_w, screen_h, screen_bpp;

 

and I put any screen related function declaration in gfx.h

 

//in gfx.h

 

int gfx_create_screen(int w, int h, int bpp);

int gfx_switch_fullscreen(int fs);

 

I also do the same with the logging module. I put the log function declaration in the log.h, and the definition and logfile handle in log.cpp

 

question:

-is what I do is right? and uh, if not, can you tell me a better way? I really really appreciate any input here. thanks!


Warcraft 3 cliff and ramp rendering

18 May 2013 - 06:54 AM

Hi people. I'm designing a format for a map in my game. I want it to have cliff and ramp, just like WC3. Thing is, I don't know how they make it work. At first I thought WC3 map was just a simple textured heightmap, but then it can have cliffs, ramps, which breaks the rules of standard heightmap. I guessed it was just a simple heightmap underneath, with "procedural" rendering for each tiles (I could see the heightmap layout in wireframe mode in the editor, thus I thought they just render each tile "differently").

 

Can anyone give me a hint on how to do that? I think I just got a few ideas, but somehow I feel not confident enough. I need the opinions of others. Thank you guys!

 

This is what I mean by cliff:

44739d1230921253-editing-cliff-skins-cli

 

and this is what I mean by "ramp" (basically it's a passable passage that connects higher tile to lower tile):

rampstart.jpg


the cost of loop in glsl

06 April 2013 - 06:29 AM

Hi all I plan to use hardware skinning, and thus I need to use loop inside the vertex shader. Last time I heard ut was bad to use loop inside shader and that I'd better unroll it. Also I heard looping and branching was badly supported. Is it true? any keyword for looking such info? thx

Recovering lost skills

27 February 2013 - 12:34 AM

Hi all, I used to be a game programmer. But two years ago life forced me to walk its hard way. My pc was blasted, I was poor as fuck and I had to work for money. So I quit programming.

Two years has passed, I have enough money to get a decent laptop. In fact I just bought one. Yesterday I turned on my laptop, got myself a cup of coffee, relaxed my hands on the keyboard. I fired up VS2010. Ready to rock. But then I just stared blank at the LED screen. I felt so weird. I seemed to have forgotten all my coding skills. I just couldn't get in touch anymore with the beautiful IDE. What's wrong with me?

Anyone ever felt the same? what should I do to get my game programming skill back? all my reference was hardcopies. And they've rotten in the warehouse :(

communicating between C++ server and Java client app

10 November 2012 - 04:31 AM

Hi fellow developers, I hope you're all fine and well.

Well I got a few question here. Basically I managed to start a simple chat application with movable avatars (like the sims multiplayer). I could code the server in C++, but the client app is meant to be installed on android mobile devices, thus I'd better code it in java.
(I'm quite fluent in C++, but java is quite new to me, although my friend said the transition wouldn't be too painful. I've read several pages of a java book and the syntax is quite similar to C++)

Now comes the complex part, which is communicating between the two languages. Here's several questions I got in my head:

1. What kind of issues that I should anticipate?
2. Aren't the sizes of datatypes in both language the same? what about the byteorder?
3. I use winsock in C++, I wonder if there's such equivalence in java.
4. I'm planning to buy a book that teaches networking in java apps. Do you have some good suggestions? (my current book is for beginner. It doesn't have networking sections in it Posted Image )

well, that's all I have in mind. I hope you guys could shed some light here. I'm so eager to learn java Posted Image .

PARTNERS