• Advertisement


  • Content count

  • Joined

  • Last visited

Community Reputation

170 Neutral

About Synex

  • Rank
  1. Hey guys, I'm having a problem with .NET applications that i write for Windows. They compile and run ok on my machine, but when i try running them on any other machine, even those on my network - it throws a SecurityException because the code is not trusted. Anyone know how to get round this problem? Or some walkthroughs about .NET code security that would solve it? Cheers Synex
  2. An engine for C# .Net

    I've just started using the .NET wrapper (Axiom) and it seems pretty good so far. Definatly as fast as OGRE at doing stuff, but with the benefit of being .NET code so well organised and expandable. I'll let you know how it goes.
  3. Well, i already wrote a GUI in DirectX, but didn't what to really use DirectX for a DB App, its a bit of over-kill, tho i bet i could do some cool things with 3D data visualization. Back on topic! *slap slap* Another good example would be Microsoft Money / MSN Messenger etc that use custom 'graphic' controls. So a beige page eh? Maybe i'll google that and see what i can find...
  4. I'm trying to look for some tutorials on how to 'skin' an application. I'm writing a database application, but would like to spice up the graphics a bit by making the window controls look a bit different. (Examples would be Media Player 9 / Limewire etc) Any ideas? Programming in .NET & C#
  5. Are you using a tree structure for all of your GUI objects and their children? I'd definatly recommend it as then you can define the children all in relation to their parents and just recursively iterate through the tree. Example: /// <summary> /// given the window relative input co-ordinate 'x', return the x position /// in global space /// </summary> /// <param name="x"></param> /// <returns></returns> public float WindowToGlobalX(float x) { // If we have no parent, assume we are the root window and that global == window if(d_Parent == null) return x; // get the global space co-ordinate of our parent's 'x' position float parX = d_Parent.WindowToGlobalX(0); // add our position to to get our 'x' position in global space parX += Position.x; // offset original position with this value to give global space location return parX; } /// <summary> /// given the window relative input co-ordinate 'y', return the y position /// in global space /// </summary> /// <param name="y"></param> /// <returns></returns> public float WindowToGlobalY(float y) { // If we have no parent, assume we are the root window and that global == window if (d_Parent == null) { return y; } // get the global space co-ordinate of our parent's 'y' position float parY = d_Parent.WindowToGlobalY(0); // add our position to to get our 'y' position in global space parY += Position.y; // offset original position with this value to give global space location return parY; } /// <summary> /// given the global space input co-ordinate 'y', return the y position /// relative to 'this' /// </summary> /// <param name="y"></param> /// <returns></returns> public float GlobalToWindowY(float y) { // If we have no parent, assume we are the root window and that global == window if (d_Parent == null) { return y; } // return input relative to our 'y' position return y - WindowToGlobalY(0); } /// <summary> /// given the global space input co-ordinate 'x', return the x position /// relative to 'this' /// </summary> /// <param name="x"></param> /// <returns></returns> public float GlobalToWindowX(float x) { // If we have no parent, assume we are the root window and that global == window if (d_Parent == null) return x; // return input relative to our 'x' position return x - WindowToGlobalX(0); } Thats how do it anyways.
  6. This is mainly a RAM usage problem right? So you'd like to reduce the amount of memory you use when you load your maps into memory? I'd simply load your map on a as-its-needed basis. So keep most of your map on disk, and only load the area around the player into memory. This kinda the thing your looking for?
  7. GUI Question

    Ok, thats a lot of questions right there: Quote:How do you guys do your GUI? I like to do mine with cheese. Graphical User Goodness Cheese. Apart from that i use a tree structure, where your root window (often the whole screen) has children (windows) and those windows have children (controls) and some of those controls have children (subcontrols). An example would be a combo box. That will have 3 children. A Textbox, a push-button and a list. This is mainly for a MS Windows type GUI which is fairly complex and probably more so than you need for your side scroller. For that, i'd texture up a few quads and display them in ortho mode on to your screen. I'll try to answer the rest later.
  8. How many threads?

    Quote:Original post by doho You need as few threads as possible unless there is a really good reason. Couldn't you use a simple webserver to give the functionality of downloading maps without disturbing your game? It surely seems alot easier. Certain of the game data is static, so gets downloaded onto the client from the server automatically when you connect (map details, item details etc.)
  9. How many threads?

    Ok. Thanks for the quick response, some really useful points here. First off, on the CPUs front... this server will likely be run on single processor systems. The idea is for players to be able to set up their own servers like Freelancer etc that other people can connect to, and i dont know of many people dedicated enough to have a dual processor system. Therefore, all threads will be run on the same CPU. Thread Pooling - looks like i'll go with this one. I'll try and work out the optimum number of threads, perhaps spliting services by threads (IE chat messages and other 'quick' things to do get stuck in one thread, heavy database calls in another thread etc.) I need a multi-threaded model to keep the response time on the client low, allowing you to keep chatting to your friends while the client is downloading game data. An example of this would be talking while downloading a map. The server would freeze up everytime someone requested a file because itd be busy sending off that file and not doing anything else. Therefore, one thread can be busy throwing files out all over the place, while another thread is receiving and sending off chat messages to all the clients etc. I suppose, by spliting different services into different threads would remove the problem of multiple threads trying to access the same resource as well (multiple threads writing to the chat log for example). I'll take a good look at Async sockets and connection pooling and let you all know how it goes. Thanks
  10. I've done a bit of multi-threaded programming in the past, but only of a very small scale. I'm busy beavering away at a game server that will serve quite a few clients. I'm just wondering how many threads can i get going at once? I realise there is probably no limit, but i'm wondering what a good theoretical limit would be. At the moment, i've got a few different thread layouts in mind: A: 2 threads per client. One send / one receive thread. Messages get put into a message store and dealt with by the main server thread. B: Multiple threads per client. Send / Receive threads, plus seperate threads for each process it asks for. Therefore, a simple 'echo' request to the server will be dealt with instantly, while longer requests such as information from the database can run in the background / files being sent from server > client. C: Thread pool. Say 20 threads running, getting handed as / when they are needed. However, if all 20 threads get bogged down doing something complicated (sending a file, large database query) then the clients will all get lagged out. Any ideas? How do the rest of you do it? What is the theoretical maximum threads you'd use? Cheers,
  11. GUIs

    Ah... the age old problem with OOP. I'd definatly recommend taking a look at CEGUI. Its a great GUI, and a great way to learn OOP.
  12. Why OOP?

    I didnt ever think OOP was all it is cracked up to be. But, i designed a windows-style GUI, and in it used OOP. I now realise that i didnt fully appreciate OOP because i didnt fully understand it. I now write all my code OOP and the benefits are beyond measure.
  13. Network Code Design

    Quote:Original post by BobV Sounds like you are on the right track. Both the client and the server should have a similar queue for handling messages. You don't want to send messages back and forth notifying whether a message was received or not; that just generates unneeded traffic. 98% of the time there won't be a need for the client to know if the message was received or not. For example, in an FPS game you would be sending messages to the server with location updates. By the time the client has received the 'Ok' message, the player would have moved anyways. For the other two percent, the server just creates a new message and sends it back to the client to be processed like any other message related event. Ok, so most people use message queues? I'll see if i can throw together something in code / a layout design or something this evening for you all to look at and pull to pieces.
  14. Network Code Design

    Quote:Original post by sodme I don't keep your mean. In server side, one socket with one client. That's ok, i dont keep your mean either. eh?!
  15. Ok, i'm pretty up to with Winsock now, i can send packets like a pro, TCP, UDP its all good. BUT! What way all a y'all integrate it into your games? The networking code throws a byte-stream into and out of your program, so do you tend to encase your individual data structures such as: byte stream into program : "<msg>FDSA£"$£"FA432432FfsaFDS<msg>FDSAFdsafds£"43243<msg>fdsafsa3432" And then split off each <msg> and handle it? Or is there a better way of doing it? Also, seeing as you want most of your network stuff running Async with your program WOULD it be a good idea to design a program like this?: MessageStruct newMessage = new MessageStruct(); newMessage.messageType = 432 <- 432 is a request for userName newMessage.callback = someFunction <- callback for when response is received QueueMessage (newMessage) <- Add message to queue in the mean time, a loop is running through the message queue sending them all off to the server... in the server: newMessage is received in the byteStream, data is retreived and added to the send message queue (server) when reply message (containing the requested data) is received by the client, the appropriate callback is called and handed the data. Is this a good way to go about these things? Or is there a much easier, less complicated or better way of doing it? Obviously, the server will hand out regular game-state updates, but often a client will request specific information from the server and will need to handle it. Any ideas?
  • Advertisement