JulianLoehr

Members
  • Content count

    16
  • Joined

  • Last visited

Community Reputation

367 Neutral

About JulianLoehr

  • Rank
    Member

Personal Information

  1. Non-Realtime games for the command line/console are a good start to get familiar with the language basics.   I like to add Tic-Tac-Toe, Connect Four, simple form of Monopoly and quiz games to the list.
  2. Do you mean http://en.wikipedia.org/wiki/Spherical_sector ?
  3. Twitch streaming

    1) 1 and even 2 Minutes are normal, especially on smaller channels. Just test whether it is running without buffering and frame drops. The delay is due to Twitchs internal processing and buffering. They added a Beta for a stream delay reduction down to 10-20 seconds, but only recommend this option when your stream is somehow very active with the chat and needs less delay. The downside is viewers with poor internet connection may have more buffering and stream lags.   2) have been already answered 
  4. Direction Booleans into single Integer

    Yes, it is for my Wiimote Device Driver. I get the input from the DPad as booleans and need them to be converted to the hat switch angles for the HID report.
  5. Direction Booleans into single Integer

    The single Direction ID is only used to be passed forward to the HID Class Driver. So i am not using it other than that i need to generate and forward it. When i want to check for directions myself i still have my initial Booleans.
  6. Direction Booleans into single Integer

    Why stop?   Waterlimons proposal looks good, i think i am going to use that.
  7. Direction Booleans into single Integer

    The 0-8 range and values are fix and cannot be changed. I forgot to mention that the code is for a Windows Kernel-Mode Driver, so it's Microsoft C and it uses the Windows Kernel-Mode Run-Time Library(Rtl) instead of STL.   On one hand i personally just don't like such nested multi-branch conditional statements. I think they are not good in terms of readability and maintainability. On the other hand i just tinkered around myself and wasn't able to find any bit pattern for such conversion. So i am just curious if there is one.   I put it into coding horros because of the forums description. If this topic might be better suited in the General Programming forum feel free to move it. 
  8. Hey,   i have Input Data from a Gamepads DPad in form of 4 Booleans (Up, Down, Left and Right). I need those to be converted into an Integer ranging from 0 to 8, where 0 is the Null State. Up 1 0000 0001 Up-Right 2 0000 0010 Right 3 0000 0011 Down-Right 4 0000 0100 Down 5 0000 0101 Down-Left 6 0000 0110 Left 7 0000 0111 Up-Left 8 0000 1000 I haven't come up with a nice solution, nor found any pattern yet. So that's what i am asking for. Is there any nice Bit Operation Magic to put that into 1-5 nice lines?   Currently i am using this trivial but horrible way:         if (Up && Down) { Up = FALSE; Down = FALSE; } if (Left && Right) { Left = FALSE; Right = FALSE; } if (Left) { ReportByte[0] = 0x07; } else if (Right) { ReportByte[0] = 0x03; } if (Up) { if (Right) { ReportByte[0] = 0x02; } else if (Left) { ReportByte[0] = 0x08; } else { ReportByte[0] = 0x01; } } else if (Down) { if (Right) { ReportByte[0] = 0x04; } else if (Left) { ReportByte[0] = 0x06; } else { ReportByte[0] = 0x05; } } So any suggestions are welcome. 
  9. What Are You Working On

    I am currently working on HID Wiimote, my very own Windows Driver.     Wii Remote Dialog before and after my driver.   Language: C SDK: Windows Driver Kit Type: Windows Kernel P'n'P Driver Projekt Site: http://julianloehr.de/educational-work/hid-wiimote/   It is a native driver to enable the Wii Remote as normal Gamepad, so you don't need something like GlovePIE. Still in a very basic state only supporting the Core Buttons and Pitch-, Roll-Rotation. But i am working on Extension and IR support.
  10.     You don't really need an Entity Class, additionally you don't need to save the Entity ID in your components. I will explain why further down.         I don't know the exact context, but i think you have to look at it like this: The "Class" is the type of the component (e.g. "Position"), for each of your component type you have a HashMap with an entity ID (the integer) and the instance of the component.   So for each component exists a Map, that saves the all component instance with their IDs. You can then easily accessing every component via its type and the entity ID.   To come back to your problem with the Entity Class. You don't need one, an entity is just an ID like a key in a Database. Your componentsStore / EntityManager acts like a Database and its tables.   When adding a component to an entity, you just add an entry to the HashMap of that component type. Deleting an entity is just removing all components with that ID from all component HashMaps.   In your system you can get the HashMap of a certain component and iterate over it. If you then need some other component of that entity, you will have always the ID and can look it up via your componentStore.   Edit: I don't know if C# has that concept of templates. If not it will be difficult to create something generic like those nested HasMaps. The benefit over your  Dictionary<uint, List<IBaseComponent>> componentStores; is that you always know which component type you want. So the nested HashMap is very cache firendly since it will only contain components of the same type and you will iterate through them very often in your systems. Additionally you are not able to easily iterate through your Dictionary only wanting a certain component type. Moreover you need to search your nested List for the right component type. 
  11. C++ multiplatform engine/framework/library?

    Another good open source C++ framework is openFrameworks. It supports Windows, Mac, Linux, iOS and Android, and features Add-ons.
  12. Have you included the second level in your Build Settings? It's another common mistake, to forget to add the scene into the build.
  13. @Frob: *Insert Morpheus Meme* What if i told you ... that wifi is not just internet */Insert Morpheus Meme* I think he meant with Wifi just Wireless LAN, which as the name states is just an LAN, where you can establish socket connections.   I didn't made anything with Android yet, but used both methods on Windows Phone, so i'm referencing to how it is made on Windows Phone. But i think it will be similiar on Android. However i will list you the features and cons/pros of both methods so you can decide on your own, wich fits best.   Bluetooth: As said you have a range up to 10m, so your players have to sit next to each other. Both smartphones will publish something like a service to find each other and then establish a Bidirectional Stream Socket like connection. This means you can send data in both directions asynchron. The connection will be peer to peer, without anything in between. Wifi/WLAN: For WLAN both devices have to be in the same network. So an access point is required, or one smartphone has to provide a wireless network. However this has to be done before they get into you game. Then it acts like a normal LAN, so you have to use sockets, connect via IPs and so on (There might be some API that provides automatic connection like this one http://developer.android.com/training/connect-devices-wirelessly/nsd.html). But the difference to Bluetooth is, you will have something like a server and a client. The server has to listen for incomming connection and the client has to connect to you server. Your range depends on the network, so both player could sit in different rooms.  I think in the end either way you will get just an data socket, where you can read write you data form and to. I didn't mentioned the data rate, but for a game that shouldn't matter at all. Only if you have to transfer very big amout of data, like images or sounds.   Best way for a customer would be to have both ways. So either they can choose what they want to use or you make automatic system, which decides what to use. Something like, first check if both user are on the same Wireless network, if so, use it. Then try to establish a Bluetooth connection, if it fails prompt the user to create a local wireless network.   And for wifi, there is a new feature called Wifi Direct, which lets you connect two devices via WLAN but without a network (like Bluetooth but uses WLAN adapter). But that is not supported on all devices, mostly only on newer ones.   For the "how do i programm it" you can look into the android documentation. Start at Bluetooth or Wifi and move along the links through connecting until sockets, where you can finally send data. 
  14. Most modern and higher languages, like Java and C#, are running in a runtime (engine like program). So if there is no runtime for you particular platform, you can't deploy you game/program on that platform. So you are dependent to others. C++ and C is compiled into machine code, which can be ran without any additional program. Furthermore, as other already stated, you have almost complete freedom to do anything in C++ and C. You can really mess around with pointers and your memory, which often results in very fast code. So the benefit is speed, which is very important in engines and games.