Jump to content
  • Advertisement

!Null

Member
  • Content Count

    49
  • Joined

  • Last visited

Everything posted by !Null

  1. !Null

    Networked Game

    Okay so. I'm working on a project for University. It's an FPS.   I have made a basic server and the client and server can communicate via UDP (fairly simple stuff)   My question basically is, how should I deal with sending data from the client to the server and broadcasting the data of all players back to the client.   I've never really done anything like this before so it's all new to me.   Any advice would be appreciated.
  2. !Null

    Networking A Game

    Okay so I'm taking this courses while I'm abroad and our final big project is to build a game (which is fine) and network it. The latter is my concern. We had a lecture / lab on building a echo server in C which i got most of I guess. But now I'm not sure how I'm suppose to mold this to help me network my game. The game is developed using a scripting language developed by the college (which has heavy hints of C++). I'm not looking for you guys to 'do my homework for me' I'd just appreciate some step in the right direction. If you need to know anything just let me know.
  3. !Null

    Networking A Game

    Thanks guys for all the support. I'll continue to try to make this work and when I'm done i'll post the result (after its submitted otherwise It wont get marked at all) Goran Milovanovic Thanks I'll have a look at it
  4. !Null

    Networking A Game

    Wait a second. From a one lecture that teaches you an Echo Server, you're supposed to know how to program an FPS networked game? I think something is missing here. Is it just a 2 player game or a true multiplayer (ie, 2 - 16)? FWIW, creating a truly robust FPS Networked game is PRETTY FRIGGING HARD. Now, you can create a protocol that runs good over LAN, but would do poorly over the internet that's not too difficult (not too difficult for someone who understand networking protocols at least). BTW, there's a networking forum here that has loads of information that you may want to look over all the posts there. [/quote] yep you got it right. We haven't been given the exact spec yet but i get the impression that a 1v1 would be enough but even if you got a 1v1 going it would be just as 'easy' to get more players going. If i could get it working over LAN that would at least be a step. I do know a little about networking but if I'mhonest I don't really like doing it from a programmatic stand point. I've been looking through some of the functions and stumbled through some networking functions NetAcceptTCP(); NetClose(); NetConnectTCP(); NetCreateChannel(); NetCreateChannelTCP(); NetDataReady(); NetGetIP(); NetReceiveFrom(); NetReceiveFromTCP(); NetSendTo(); NetSendToTCP(); NetSetMulticastIP(); NetVarReceiveFrom(); NetVarReceiveFromTCP(); NetVarSendTo(); NetVarSendToTCP(); [/quote] Also thanks I might move the post over. And i'll have a look a look through there too.
  5. !Null

    Networking A Game

    It's an FPS
  6. !Null

    Switch vs if else

    You are right. This is a language dependent thing because i know that in java 1.7 switch statements support strings
  7. !Null

    Top Down TBS Tile Selection Help

    here a quick example I wrote up. the code is java but the idea is the same package example; import java.awt.event.MouseEvent; import java.awt.event.MouseListener; import java.awt.*; import javax.swing.*; public class Main implements MouseListener { private final static int SCREEN_WIDTH = 640; private final static int SCREEN_HEIGHT = 480; private final static int tile_size = 32; private int map[][]; private int mousex, mousey; private JFrame frame; private JPanel panel; public Main() { map = new int[SCREEN_WIDTH / tile_size][SCREEN_HEIGHT / tile_size]; frame = new JFrame(); panel = new JPanel(); panel.setBackground(Color.red); frame.setSize(new Dimension(640,480)); frame.setContentPane(panel); frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); frame.addMouseListener(this); frame.setVisible(true); int k = 0; for(int i = 0; i < map.length; i++) { for(int j = 0; j < map.length; j++) { map[j] = k; k++; } } } public static void main(String[] args) { Main main = new Main(); } @Override public void mouseClicked(MouseEvent e) { System.out.println(map[e.getX() / tile_size][e.getY() / tile_size]); } @Override public void mousePressed(MouseEvent e) { } @Override public void mouseReleased(MouseEvent e) { } @Override public void mouseEntered(MouseEvent e) { } @Override public void mouseExited(MouseEvent e) { } }
  8. !Null

    Top Down TBS Tile Selection Help

    say you have a map array which is 32x32 (tiles of size 32x32 not a whole picture) and say your screen size was 640x460 this gives you a total number of tiles x:20 y:15 20 x15 = 300 tiles this means that we can do very easy mouse translation. when you click the mouse. get the mouse x and y location of the click/ then do something like int tile = map[ (int)mouseX / 32][(int)mouseY / 32] so to show an example of this. imagine your screen 640x480 and imagine we click at mouse location 450 150 450 / 32 = 14 150 / 32 = 4 so now we have our tile 14 across and 4 down which would select tile 56. as for making the tile brighter im not sure
  9. Sweet. be sure to let us know how you get on
  10. Okay. The simplest way to do a tiled map with textures (images) is simple You have your width of your window and the height of the window (say 640x480) and then you want to assign a tile size. this will be the size you want the 'environment' to be (not the characters or enemies etc) so trees,grass all that stuff. I usually pick either 16x16, 32x32 or 64x64 for my tiles. Then (if we are not using slick and tiled maps) we do the following below. static final int WIDTH = 640; static final int HEIGHT =480; int tileSize = 32; int map[][] map; Random rand = new Random(); public void init() { map = new int[WIDTH / tileSize][HEIGHT / tileSize] for(int i = 0; int i < map.length; i++) { for(int j = 0; j < map.length; j++) { map[j] = rand.nextInt(2); } } } } we create a 2D array for our map (just like a matrix) and the size is basically how many tiles across and down your map is. So 640 / 32 = 20. 480 / 32 = 15. (you can obviously create your own maps and load them in from a text or something but That's too much detail for the moment. after that all you have to do if loop through the code. if the element at index i,j = 0 we draw nothing (or a default tile) and if the element at index i,j = 1 we draw something interesting for(int i = 0; int i < map.length; i++) { for(int j = 0; j < map.length; j++) { switch(map[j]) { case(0): g.drawImage('your default tile',i*32,j*32); break; case(1): g.drawImage('your interesting tile',i*32,j*32); break; default: g.drawImage('default tile',i*32,j*32); break; } } } } and this will draw out your tile map. after which you draw your player after you draw you map, so that the player is rendered on top of the map and not behind. then when you want to move a player between somewhere on the map. you can just to tile movement (eg move it by a tile at a time rather than pixels at a time) The slick2D way is a lot easier in my opinion though. If you make a 2D map using Tiled map editor. you can load and display the map very quickly like this import org.newdawn.slick.*; public class Game extends BasicGame { private TiledMap map; public Game() { super("This is where you put the title"); map = new TiledMap("location") //and some other parameters I can't remember off the top of my head. Check the javadock for slick } public static void main(String[] args) { AppGameContainer gc = new AppGameContainer(new Game()); gc.setDisplayMode(640,480,false); gc.start(); } @Override public void init(GameContainer container) throws SlickException { } @Override public void update(GameContainer container, int delta) throws SlickException { } @Override public void render(GameContainer container, Graphics g) throws SlickException { map.render(); } } Simples ;). and you can still do your gird movement and stuff the same way. Sorry if this is a long winded explanation. if something is unclear just ask. hope this helps
  11. Oh yeah Slick2D is up to date. You just need to download the Nightly build (as that's always the most recent update) I'm just a bit confused as to why you have a grid of buttons. Do you want to select characters with the mouse or whatever and have them move to that point (animating while moving?) If so there are easy ways of doing this. Also you can used Tiled editor to make your tiled maps and loads them into java with the Slick2D methods
  12. !Null

    Integer multiplication, division

    Could you please elaborate on that? What exactly is the factor that causes the calculation to be processed in 16-bit? Shouldn't the program detect that its running out of precision and automatically use a bigger (i.e. 32-bit) temporary buffer? Which variables exactly should be increase in size? EDIT: Is there a way to increase the temporary buffer size without changing the variable data types? [/quote] That's not how it works. Yes there is something that causes the calculation to be processed in 16-bit...its the fact you told it that your values are all 16 bit signed integers. when you get an overflow, instead of crashing your program. The value gets wrapped around. so when you reach the max value, it goes back to 0 and starts counting up again. Is there a reason you chose int16_t or did you copy it from somewhere. Like I said change it to int32_t or higher and see the results
  13. If you are using Java + Netbeans have you had a look at Slick2D. http://slick.cokeandcode.com/ I've used it for many 2d tile based game project. It has support for tiled maps and makes animation easy. If you wan't more info you should have a look at it and you can send me a message or something. or ask more questions here.
  14. !Null

    Integer multiplication, division

    I think you have found your answer from most of these replies. If you don't believe them then change them to int64_t and see the result
  15. So guys. I've been learning to use the UDK and been messing around with kismet and matinee and all that other stuff. I feel confident in it, but still only at a beginners level. My question is. I kinda want to get custom characters and learn how to load them in and all that stuff. I have 3D's Max installed, but I haven't used it before. Is it worth deviating and learning how to make custom characters and loading them in. Or should I concentrate on learning UDK more and more until it becomes like programming 2D games (which for me, I can do to a Intermediate -> Advanced level)? I look forward to all your opinions and suggestions.
  16. !Null

    UDK + Character models

    My profession is Software engineering and I have a part time job writing ASP.NET software. I'm quite advanced with Java, c#. and I am intermediate with c++
  17. !Null

    IDE most comparable to VS

    Dude InteliJ . it's just like visual studio for java. it's crazy
  18. Tiled map does not support different Tile Sizes in the same map. Why would you want to? Elaborate please
  19. So I'm trying to explore more methods of making games for experience. And a friend of mine can make raycasting games quite well (Like Wolfenstein). However He tried to explain how the code works and he just failed. Also I've checked a few places Online but theory doesn't work with me unless I see the code explained. Can any of you wonderful GameDev people Help me out. Maybe with some pointers (not 0x00000000) or some pseudo code examples to explain to me how to get at least a floor and ceiling done. I hope someone can help.
  20. !Null

    wolfenstein 3D (How To)

    Not a problem Ray-casters are always fun projects to work on. They're a very interesting piece of history. It's amazing to me, even today, the results you can get with the relatively simple code and basic trigonometry. I'm really itching to put together a ray-caster now...[/quote] you totally should man, I like trying old things because it's good to get a sense of how things evolved. If you wanna see the code then let me know
  21. !Null

    wolfenstein 3D (How To)

    caldiar I just wanted to say thanks for the quick detailed reply.
  22. !Null

    pong in java

    public void run() { while(t!=null) //animation loop { updateBall(); updateUserPaddle(); updateComputerPaddle() drawToBackbuffer(); try { Thread.sleep(20); }catch(InterruptedException ie){} } } [/quote] you forgot your semicolon at the end up updateComputerPaddle() Thats probably why its not working. What IDE are you using. did it run? Also, just something I noticed. the collision looks okay for when the ball bits the players panel. but when it hits the computer panel, it looks like it is not bouncing back until ballx + ballWidth <= computerPaddleX + computerPaddleWidth if you get what I mean
  23. if you want arrays of Changing sizes, then a fixed array just isn't going to cut it. if you needing to cut out elements in unpredictable places and then shrink the size. consider linked lists. with linked lists you can remove and element and then change the link to the next element: <el1> -> <el2> -> <el3> -> <el4> -> <el5> <el1 -> <el2> -> <el4> -> <el5> That is a pretty vague example but you get what I mean. figure out what exactly the person you are doing this for wants exactly.
  24. !Null

    All from scratch

    I do agree with you. But like I said, although there are many questions like this on this site. It's good for them to be told from many people and get it put in perspective. I also think the goals of people who have studied some sort of computing subject such as software engineering or computing science (like myself) or are just self learning can be a bit different because they haven't been thought making all the little SEEMINGLY pointless programs that actually teach you a lot about OOP and such
  25. !Null

    All from scratch

    There is nothing wrong with having ambition and a goal, even if it is unrealistic. As long as you keep taking the stepping stones to get there. But its good to ask people, because then your goal is put in perspective.
  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

GameDev.net 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!