• Advertisement


GDNet+ Basic
  • Content count

  • Joined

  • Last visited

Community Reputation

1941 Excellent

About DvDmanDT

  • Rank

Personal Information

  • Interests
  1. Favourite cocktails?

    Something like 85% of my alcoholic intake comes from different types of beer and most of the rest is pure whiskey, rum, cognac or similar, but sometimes I mix cocktails/whatever. Baccardi limon + cola is probably my most common one, but nothing special at all. The lemon flavor works nice with coca cola and makes the drink a bit more fresh than regular white or spiced rum imho, but the primary motivation is the simplicity. Vodka + tropical juice + few drops of grenadine - This is a slightly modified screwdriver, or a modified tequila sunrise if you will. The tropical juice makes it a bit more "summer-y" and the small amount of grenadine makes a nice addition, if nothing other than to make the appearance a bit layered/toned/whatever. Strawberries + spiced rum + lime juice + sugar + crushed ice - Lazy version of a Strawberry daiquiri. A bit more involved to create since it requires a blender, but it's an incredibly nice drink for a hot day in the sun, that lasts long, tastes great and looks/feels somewhat luxury. I usually just pour some sugar into the blender instead of boiling sugar+water to create syrup. This one also works really well as a non-alcoholic drink. I highly recommend fresh strawberries (raspberries also work well) as frozen berries can easily make the drink too "thick" to be drinkable. For bonus points, decorate the glass with a strawberry and/or a mint twig. Vodka + white wine + sprite + elderberry juice + frozen berries (ie raspberries and black currant) - This is a perfect mix to serve in a bowl with some ice as a welcome drink or similar. 30-40cl vodka, 50-60cl wine, 1-1.5L sprite and maybe 20-30cl elderberry juice, then decorate with some frozen berries which should also give it a bit color. A word of warning though, the berries eventually end up everywhere so stuff like white carpets and furniture are not optimal.
  2. C# Returning Buffer from C to C#

    I've never used BSTR myself, but personally I think it looks rather scary. It will probably not work (or work strange) with other data types and I'd also be very wary of cross platform compatibility with this. On the other hand, if it's not for a long-term cross platform project then the easiest and simplest way is to be preferred I suppose. Something like this is how I would do it: static class PInvokeThing { [DllImport("Important.dll", CharSet = CharSet.Ansi, CallingConvention = CallingConvention.StdCall)] private static unsafe extern int ConvertHodgmanKylotanjbadamsfrobRavyneApochPiQSeanMiddleditchrip_offspaceratLightness1024_to_String(string stuff, out byte* outPtr, out int outLen); [DllImport("Important.dll", CharSet = CharSet.Ansi, CallingConvention = CallingConvention.StdCall)] private static unsafe extern int FreeBuffer(byte* ptr); public static string ConvertTheString(string input) { unsafe { byte* ptr; int len; var result = ConvertHodgmanKylotanjbadamsfrobRavyneApochPiQSeanMiddleditchrip_offspaceratLightness1024_to_String(input, out ptr, out len); // check result var barr = new byte[len]; for (int i = 0; i < len; i++) barr[i] = ptr[i]; FreeBuffer(ptr); // probably check this too return Encoding.Default.GetString(barr); } } } This was written mostly from my head and may contain minor mistakes, but the idea should be usable for most types of data etc.
  3. C# Returning Buffer from C to C#

    If you are actually working with strings in particular, the C# side should use string for the C#->C param, then probably a StringBuilder with a predefined size for the C->C# "return value". You should probably make sure to select reasonable MarshalAs options anyway though. Another way, that is possibly easier (but uglier) is to just use unsafe and IntPtr. Depending on your target that may cause problem due to the unsafe requirement. In this case, make sure to look up the fixed and unsafe keywords. If I understand things correctly, this will bypass most if not all marshalling and copying, but is less clean and "safe". If you are working with arrays of primitives, you may need to tag the parameters with [In] and/or [Out] depending on the direction of the data. That also applies to ref parameters. If you need to pass structs, make sure you use struct in C# and make sure to tag any non-primitive types (including arrays of primitive types) with reasonable MarshalAs values and make sure to tag the entire struct with [StructLayout(LayoutKind.Sequential)] (or whatever the explicit version is in which case you should tag each field with their absolute offset as well). Let it be known that I have seen unexpected or problematic behaviour when trying to pass structs with non-primitive members though. In one of those cases I had much better luck serializing the data to a byte array and pass it as an IntPtr instead of trying to get the marshalling to work correctly, but that particular case was a rather complicated struct in an API beyond my control with nested structs, strings and other fixed size arrays of nested structs and stuff, so YMMW. [Edit] I just realized I missed a part of your post where you wanted to allocate the return value in C. I'm not sure that's what you actually want given your C signature which looks more like you want to pass in a preallocated buffer (in which case you want to use StringBuilder) but if you actually want to allocate it in your C function, I would return it as a pointer and use it with IntPtr in C#, then define some form of FreeString() function in your C dll and pass that IntPtr back once you've manually copied the data into a C# array/struct/string/whatever. Which is how I would do it in C if I was designing an API, even if it was not strictly meant to be used from C#.
  4. I really want to go back to the golden era of Minecraft modding, like back in 1.7.10. I had sooo much fun. So many great mods, so many great packs, that are currently unplayable or discontinued etc since the base game progresses faster than what the mod devs can keep up with. There are lots of clones etc, but none of them come close to modded MC in terms of content. I really like building stuff with my friends. MC is one example, games like Anno or The Settlers are others. I'd really love some form of building game which is endless and continuous, that allows for clever and/or optimized designs, yet has some form of quests or challenges that scales with progression. Stardew Valley is a game that really impressed me in how it combined the building/progressing, the social RPG aspects, the questing, the "just one more turn" thing and the collectibles aspects all into one really well made game. Really amazing game and I look forward to the multiplayer version, but it really does have an ending. MC is rather unlimited, especially with mods, but lacks in challenges and quests, especially that scales with player progression. Settlers and Anno have very specific challenges, but have very limited content. After a while you are just "done". I'm currently working on some form of Anno/Settlers game where we might allow maps to be expanded WZ2100 style and new more powerful enemies or whatever be generated once the player defeats the current one. Either that or a Stargate inspired world where you would have a home and build some form of base then explore the universe through portals and find friends and foes with various levels of power where you go.
  5. Are there any WinForm based games on Steam?

    I would be greatly surprised if that was the case. Why would anyone want to do that? WinForms (assuming you are talking about the old .NET gui system) is certainly not made for games and though it's supposedly cross platform these days, it's incredibly buggy on non-Windows platforms. Something like MonoGame is a muuuch better option, even if that too is somewhat buggy.
  6. I tried doing something similar to this 10-12 years ago when I was trying my hand at a Liero clone, but with N stages/copies/whatever (ie 5). The idea was basically to store a complete copy of the game state up to N frames back. This way I thought I could back up and re-run the simulation when an old network packet arrived. The reason I wanted to do it that way is that it (Liero that is) is a rather fast paced action game, with thousands if not millions of objects and destructible terrain, where butterfly effects can potentially be a giant problem, while back then we also had much crappier connections than we do now. Anyway, my conclusion was basically what swiftcoder said, memory bandwidth sucks. Back then we had something like 1-2gb/s, which I thought would give me something like 20MB/frame, but I didn't initially realize that it was 20MB spread across the entire frame, not a quick action at the beginning of the frame. In short, the copying alone ate every last slice of juice my high end P4 system had to offer at the time.
  7. Optimizing Tile Maps

    I'd guess the general consensus is going to be that you are probably much better off optimizing something else where it is more likely to make a notable difference, but other than that I can't really think of anything.  :rolleyes:
  8. Trying to remember the name of a game.

    Silverfall? Never played it and doesn't fit the timeline perfectly, but the story (according to wikipedia) starts with some form of tutorial where some evil mage destroys a city, which results in some chaos and the early game may play out near a refuge camp. Do you remember if the camera rotated or if it was fixed, and if fixed, could it possibly be 2D or are you certain it's 3D?
  9. Trying to remember the name of a game.

    Neither Titan Quest or Dungeon Siege fit the description.   It depends a lot on how much you squint your eyes. Titan quest has lots of temples and villages at least, and is kindof about killing a god, at least with the expansion. Dungeon Siege had som custom maps and generally very varied terrain etc. Then again, apart from the fallen tree, you could almost squeeze Diablo in there somewhere.. Was it singleplayer? Did you control a single character or a party? What was combat like? Turnbased, semi-turnbased (like NWN) or "live"?
  10. Trying to remember the name of a game.

    If not Silver, could it be titan quest or dungeon siege? I also vaguely recall a game with ties to northern mythology that could possibly fit in.. If not Silver, could it be titan quest or dungeon siege? I also vaguely recall a game with ties to northern mythology that could possibly fit in, but I have no idea about the name.
  11. I want to experiment with different designs and get a feel for their characteristics, pros and cons etc. For example, it might be very easy to design a system that is "clean" and easy to extend etc, but that may be impractical for some algorithms or inefficient in some ways. For example, in my RTS with lots of units, I want to have a status effects system. It's very easy to create a list of BaseStatusEffect for each unit, and just call the Update() method for each effect for each unit each frame etc, but it's going to be inefficient and may have GC implications and what not. There are lots of solutions, but how do I list them, compare them and so on? I also have a scenario where I have a bit of a dependency hell, and I feel like I have very poor tools to experiment with it and get a feel for the impact of different solutions. I keep feeling that someone should have come up with a much better tool for things like this by now, but I've never found one.
  12. Hi, I was wondering what you guys are using to design your technical solutions. Code architecture etc if you will. Is it still UML or has someone come up with something better or at least different yet? If you are using a software tool, then which one? If not, do you have some other method, like writing a text-description, code skeletons, mindmaps on physical paper or what? I'm asking because I've never really liked UML but I've also never really found any sane alternatives..
  13.   Do not modify WinForms stuff from computers with different DPI scaling enabled! It completely fucks up if you do that. If it's an option for you, consider just disabling all DPI support and let Windows deal with it instead. If you do that, you can code as if DPI stuff doesn't exist and Windows will magically just scale up everything to match user settings.  <asmv3:application> <asmv3:windowsSettings xmlns="http://schemas.microsoft.com/SMI/2005/WindowsSettings"> <dpiAware>false</dpiAware> </asmv3:windowsSettings> </asmv3:application>
  14.   It does, but the handling is pretty much awful. My best success with DPI on Winforms so far has been to explicitly disable it in the manifest, letting Windows scale up the application automatically. Results in some blur, but at least it's consistent. I don't remember exactly what was our primary issue, but I think it was related to custom drawing of controls. That part doesn't scale automatically or something while other things do.
  15. Game Programming (before DOOM...game engines)

      A couple of years ago, maybe 2011-12, my college had a visit from the lead programmer (I think) of a large Swedish game developer, who worked on a fairly successful AAA title which was released on at least PS3 and PC. They had more or less banned large parts of C++, including things like templates since they increased code size and compilation times too much. Code size was a big thing for them due to the PS3's CELL architecture. They also said something along the lines of "Ignore those advices about trusting the compiler to generate fast/good code, that only works in trivial scenarios and unit tests, in the real world you'll need to drop down to assembly and optimize by hand to get good performance". He did repeatedly talk about how you should always profile and base your efforts on that though.
  • Advertisement