• Hey, guest user. Hope you're enjoying NeoGAF! Have you considered registering for an account? Come join us and add your take to the daily discourse.

Indie Game Development Discussion Thread | Of Being Professionally Poor

Status
Not open for further replies.

JulianImp

Member
I am thinking of releasing a PC version first, in a "pay what you want" form. What do you guys think about that?

I think first releasing a game as in PWYW form will ultimately hurt sales. From what I've gathered, most games sell the most copies in the first few weeks upon release, so it'd be bad if that first wave of sales gave you lackluster profit.

Another thing you should focus on prior to deciding the price would be promoting the game as much as possible, since people won't be buying something if they don't know it exists. I'm not good with marketing, but I guess you could do something like encouraging people to retweet or like the game on Facebook in order to discount the game price by some amount (basically, you'd slightly cut profits while increasing awareness, and thus potential sales), as if they were Kickstarter stretch goals (ie: 1,000 likes/RTs = game 5% off, 5,000 = 10% off, all the way up to 75% off).

Please take this suggestion with a grain of salt, though, since I've never marketed anything in my life so far.
 

Duderino

Member
I honestly don't understand why it should be so difficult to create a white texture, let Unity Pro do its shadow stuff, and then delete any pixel with a color value of white. = P
Unfortunately I do not currently have Unity Pro, but this may be a solution. Some of the surface shader blending options may be useful as well.


On a different note, I'm streaming more character modeling for Air Dash Online at 7:30 PST. Very close to wrapping up Tesla's high resolution sculpt, so tonight I'll be starting the game level mesh.

rXcKlqa.jpg
IDtpU6e.jpg


In the process I'll be using my own custom retopology tool, RetopoG, as well.

Again, thanks to Clash Tournaments for hosting:



(Click Here to Watch at 7:30 PST)


As always feel free to come in and chat about anything related to game development, fighting games, Smash Brothers, Unity, 3D, or whatever else you feel like. A few of the other JV5 team members typically make an appearance as well.
 

usea

Member
Cool, thanks for the heads up on the modeling. I missed the last one. And all the links to the archived copy didn't work.

Looking forward to ADO
 

benSks

Neo Member
Blender is not intuitive, but I think it can actually be a very productive work environment if you put the time in to learn the techniques. And like I may have said before, in addition to Google the IRC channel is very populated and very helpful.

I find blender actually amazingly fast now after spending a bunch of time getting used to it. I've used it for all the 3d on my last two game projects and even if i could afford Maya or Max i don't think i'd bother switching at this point.
 

Duderino

Member
I find blender actually amazingly fast now after spending a bunch of time getting used to it. I've used it for all the 3d on my last two game projects and even if i could afford Maya or Max i don't think i'd bother switching at this point.
To be fair, any 3D app can be amazingly fast once you get comfortable. I find Maya, Modo, XSI, and Silo to all be somewhat similar. Max and Blender, are both little more foreign, each in different ways. I typically only open Blender or Max for very specific purposes, or in Max's case, unless the game I'm working on calls for it.


I'm not sure if Pixar's Catmull-Clark OpenSubD has been implemented in Blender yet, but if not that is certainly a good reason to try an app that does.
 

benSks

Neo Member
To be fair, any 3D app can be amazingly fast once you get comfortable. I find Maya, Modo, XSI, and Silo to all be somewhat similar. Max and Blender, are both little more foreign, each in different ways. I typically only open Blender or Max for very specific purposes, or in Max's case, unless the game I'm working on calls for it.


I'm not sure if Pixar's Catmull-Clark OpenSubD has been implemented in Blender yet, but if not that is certainly a good reason to try an app that does.

Sure, but blender is free.

When i started game development using it, i wasn't sure if it would be a viable alternative to Maya or not. - A couple years later and i think i'd find it hard to switch back.
 

Blizzard

Banned
Right, I'm not saying Blender is necessarily better than expensive tools, but if you don't have a student license for those expensive tools, at minimum I believe Blender can still be quite good after the learning curve.
 

Feep

Banned
But you have to generate 3d geometry the matches your 2d geometry right? I'm worried that if it doesn't match it exactly then no matter what clever tricks you employ your character shadows won't look right on the geometry.

Are you saying the prebaked shadows would be hand painted or that they would be generated from the same 3d geometry?
The prebaked shadows (from other environment structures) will be hand painted.

The major 3-D geometry needs to be there anyway, for pathfinding and collision. I just want all of it to be invisible. That 3-D geometry will be placed directly over their corresponding analogues in 2-D, so the shadows will match. For now I'm only considering the ground and all major walls...the detail and smaller objects and whatnot won't be modeled in 3-D. This means that the shadows won't be perfect if they happen to fall across those minor bits, but I'm not terribly worried.

Unfortunately I do not currently have Unity Pro, but this may be a solution. Some of the surface shader blending options may be useful as well.
Thanks! I'll check it out.

Edit: Holy shit, it works. Incredible. Your Google-Fu is intense. It even casts shadows onto characters correctly!

Double Edit: It only seems to work on directional lights, which sort of sucks...but oh well.
 

AlexM

Member
I've always pretty much loved Maya, Max and XSI. Modo is cool but I need more time with it and don'\t have access to it.

Blender on the other hand I just can't get into. I just really don't like the interface. Personal issue of course. It helps to re-do the hotkeys though.
 

missile

Member
For some reasons I have to use an interface (class library) covered in a C#
dll to enhance a certain program with a plugin. I already wrote a small plugin
using the given interface. (Btw; I wrote my first C# lines, yesterday. And I
don't won't to write much more.) My question is, does there exist a native
interface from which I can call C or C++ functions? Am an entire n00b within
this regard. My situation is as follows;
Visual Studio 2012:
- a project in C/C++ (software renderer)
- a C# class library (plugin)

I just want to call the C/C++ methods from C#. Does anyone have any
experience with such a setup and knows some of the oddities involved?
 

Margalis

Banned

Feep

Banned
Did you try adding the optional param fullforwardshadows if it was missing? ( http://docs.unity3d.com/Documentation/Components/SL-SurfaceShaders.html )

Apparently that adds forward-rendererd shadows to things other than directional lights.
Yuuuup, that worked. Shadows now appear over all elements. I still have a minor issue in that point lights are actually lighting up the transparent textures to translucent in addition to casting shadows...let's see if I can figure out a way around that...directional lights don't seem to do that.

Edit: Here's the code, if anyone wants to look or use it!

Code:
Shader "Custom/Matte Shadow" {
     
    Properties {
        _Color ("Main Color", Color) = (1,1,1,1)
        _MainTex ("Base (RGB) Trans (A)", 2D) = "white" {}
        _Cutoff ("Alpha cutoff", Range(0,1)) = 0.5
    }
     
    SubShader {
        Tags {"Queue"="AlphaTest" "IgnoreProjector"="True" "RenderType"="TransparentCutout"}
        LOD 200
        Blend Zero SrcColor
     
    CGPROGRAM
     
    #pragma surface surf ShadowOnly alphatest:_Cutoff fullforwardshadows
          
    fixed4 _Color;
     
    struct Input {
        float2 uv_MainTex;
    };
     
    inline fixed4 LightingShadowOnly (SurfaceOutput s, fixed3 lightDir, fixed atten) {
        fixed4 c;
        c.rgb = s.Albedo*atten;
        c.a = s.Alpha;
        return c;
    }
     
    void surf (Input IN, inout SurfaceOutput o) {
        fixed4 c = _Color;
        o.Albedo = c.rgb;
        o.Alpha = 1;
    }
    ENDCG
    }
    Fallback "Transparent/Cutout/VertexLit"
}
 

Tiu Neo

Member
For some reasons I have to use an interface (class library) covered in a C#
dll to enhance a certain program with a plugin. I already wrote a small plugin
using the given interface. (Btw; I wrote my first C# lines, yesterday. And I
don't won't to write much more.) My question is, does there exist a native
interface from which I can call C or C++ functions? Am an entire n00b within
this regard. My situation is as follows;
Visual Studio 2012:
- a project in C/C++ (software renderer)
- a C# class library (plugin)

I just want to call the C/C++ methods from C#. Does anyone have any
experience with such a setup and knows some of the oddities involved?

You can use DLLImport. If possible, use C functions as the extern calls, it's easier to find your entry point like that. I'll give you a simple example, so you can get started.

To expose your functions, you can simply do this on your .h file:

(Windows)
Code:
extern "C"
{
    __declspec(dllexport) int function_a(int x);
    __declspec(dllexport) void function_b();
    ...
}

(Linux/Others)
Code:
extern "C"
{
    int function_a(int x);
    void function_b();
    ...
}

Then, on your C# code, you can create one or more classes that encapsulates your calls:

Code:
using System;
using System.Runtime.InteropServices;

public class ExternCalls
{
    [DLLImport("yourdll.dll")]
    int function_a(int x);
    [DLLImport("yourdll.dll")]
    void function_b();
}

Of course, if needed, you can use .so files instead of DLL files on Linux, for example.

That's a very simple example, but I hope it helps you at least a bit. For more info:
http://msdn.microsoft.com/en-us/library/aa288468(v=vs.71).aspx

Of course, for more complex calls, it's a bit more complicated. You can also do C++ calls that way, but you need a few extra parameters on your DLL Import.

Good luck, I hope this helps you.
 
I'm pretty sure this has been asked multiple times but can't find the answers in the thread. Any good page for free music and sound effects?
 
I really would like a cue about that too. I am in dire need of "videogamey" sound effects.

I don't mind it not being videogamey for the music. Plain old classical music could work good enough for me if I find some pieces that suit the theme, it worked well enough in games like flotilla.
 

GulAtiCa

Member
I was wondering about that as well. I use Unity, so I have access to some of the free music/sound effects on the asset store. But would be nice to have access to bigger selection.

Also in other news, nothing to exciting, but just made a simple moving platform that moves on waypoints I set as well as learned how to keep objects alive even after a new level is loaded. Glad to be learning more about Unity. My game is starting to come together. My 1st level is pretty much done.
 
Looking at this thread again recently finally got me off my ass and started getting back into game development.

Starting small so I just picked up Game Maker and starting to get things going with it. I'm no coder and more of an artist so I thought Game Maker is the best option for ease of use and versatility for me.

Well, wish me luck!
 
Looking at this thread again recently finally got me off my ass and started getting back into game development.

Starting small so I just picked up Game Maker and starting to get things going with it. I'm no coder and more of an artist so I thought Game Maker is the best option for ease of use and versatility for me.

Well, wish me luck!

I love GM, it's a great entry level tool. Don't know much about it now days but back in 6.0 was awesome.
 

missile

Member
You can use DLLImport. If possible, use C functions as the extern calls, it's easier to find your entry point like that. I'll give you a simple example, so you can get started.

To expose your functions, you can simply do this on your .h file:

(Windows)
Code:
extern "C"
{
    __declspec(dllexport) int function_a(int x);
    __declspec(dllexport) void function_b();
    ...
}

(Linux/Others)
Code:
extern "C"
{
    int function_a(int x);
    void function_b();
    ...
}

Then, on your C# code, you can create one or more classes that encapsulates your calls:

Code:
using System;
using System.Runtime.InteropServices;

public class ExternCalls
{
    [DLLImport("yourdll.dll")]
    int function_a(int x);
    [DLLImport("yourdll.dll")]
    void function_b();
}

Of course, if needed, you can use .so files instead of DLL files on Linux, for example.

That's a very simple example, but I hope it helps you at least a bit. For more info:
http://msdn.microsoft.com/en-us/library/aa288468(v=vs.71).aspx

Of course, for more complex calls, it's a bit more complicated. You can also do C++ calls that way, but you need a few extra parameters on your DLL Import.

Good luck, I hope this helps you.

Hey, many thanks! Got it working on first try. Just need to find out about
Marshaling & Co. But for one I can't import the dll via the C# Reference
Manager for looking at all the exporting functions in there, since it isn't a
COM file or whatever is needed here. Is there a method associating a dll file
within a C# project such that I can browse all the exported functions?
 

usea

Member
Hey, many thanks! Got it working on first try. Just need to find out about
Marshaling & Co. But for one I can't import the dll via the C# Reference
Manager for looking at all the exporting functions in there, since it isn't a
COM file or whatever is needed here. Is there a method associating a dll file
within a C# project such that I can browse all the exported functions?
I don't think you can a reference to an unmanaged dll Visual Studio like that. But I'd love to find out I was wrong.
 

Feep

Banned
So, I'm organizing things in Unity the way I was in my prototype. Which is to say, I have a UnitManager class, which manages a List of squads, which each manages (formations and stuff) a List of soldiers. Nice and clean, right? In my prototype, I could do something like this:

unitManager.squads[0].soldiers[0].name = "Feep";

But in Unity I have to do this:

unitManager.GetComponent<UnitManager>().squads[0].GetComponent<Squad>().soldiers[0].GetComponent<Soldier>().name = "Feep";

Which is incredibly bulky. I guess I could just set that equal to like tempSoldier and then work off of that, but I still need to reassign tempSoldier all the time if I need to access lots of soldiers.

Anyone with best practices here?
 

Margalis

Banned
But in Unity I have to do this:

unitManager.GetComponent<UnitManager>().squads[0].GetComponent<Squad>().soldiers[0].GetComponent<Soldier>().name = "Feep";

Which is incredibly bulky. I guess I could just set that equal to like tempSoldier and then work off of that, but I still need to reassign tempSoldier all the time if I need to access lots of soldiers.

Anyone with best practices here?

Generally what I do if I have a game object with some components on it is have one component that maps to a C# class that represents what that gameObject is and I store references to that C# class instance rather than to the game object.

So say in your case you have a game object that represents a squad and it has some components on it including a Squad component. In that case I would have unit manager store a list of Squads. (You can always go from there back to the game object)

If Soldier is a game object with stuff like a transform (I guess technically all game objects have transforms), collider, model, etc, as well as a Soldier component, I would likewise keep a reference to that Soldier component.

In your code just from the variable names clearly you are thinking of unitManager as being the thing with the UnitManager component on it, and squads as being a list of things that have the Squad component on it - you are expecting them to be typed in that fashion and not just generic game objects.

I kind of started doing things the same way when I started with Unity. I have a lot of factory classes that create a gameObject and attach a script to them, originally all of these classes returned the game object but over time I moved towards making them return the script component instead.
 

charsace

Member
So, I'm organizing things in Unity the way I was in my prototype. Which is to say, I have a UnitManager class, which manages a List of squads, which each manages (formations and stuff) a List of soldiers. Nice and clean, right? In my prototype, I could do something like this:

unitManager.squads[0].soldiers[0].name = "Feep";

But in Unity I have to do this:

unitManager.GetComponent<UnitManager>().squads[0].GetComponent<Squad>().soldiers[0].GetComponent<Soldier>().name = "Feep";

Which is incredibly bulky. I guess I could just set that equal to like tempSoldier and then work off of that, but I still need to reassign tempSoldier all the time if I need to access lots of soldiers.

Anyone with best practices here?

I haven't used Unity as much as you have, but isn't component lookups using strings slow? Is it notieceable to you?
 

Feep

Banned
Generally what I do if I have a game object with some components on it is have one component that maps to a C# class that represents what that gameObject is and I store references to that C# class instance rather than to the game object.

So say in your case you have a game object that represents a squad and it has some components on it including a Squad component. In that case I would have unit manager store a list of Squads. (You can always go from there back to the game object)

If Soldier is a game object with stuff like a transform (I guess technically all game objects have transforms), collider, model, etc, as well as a Soldier component, I would likewise keep a reference to that Soldier component.

In your code just from the variable names clearly you are thinking of unitManager as being the thing with the UnitManager component on it, and squads as being a list of things that have the Squad component on it - you are expecting them to be typed in that fashion and not just generic game objects.

I kind of started doing things the same way when I started with Unity. I have a lot of factory classes that create a gameObject and attach a script to them, originally all of these classes returned the game object but over time I moved towards making them return the script component instead.
That was a little hard to follow, but I think you're saying that instead of my unit manager having this line:

List<GameObject> squads;

Use this line instead:

List<Squad> squads;

Which I tried. The problem here is that Unity yells at me that I can't create new objects that descend from MonoBehavior using the keyword "new", I have to use AddComponent<>(). And Squad has to descend from MonoBehavior because it needs to use Instantiate to create prefab soldiers.

Or are you saying have both, and just maintain the Squad list as references to the Squad components of the GameObject list?

Edit: After messing around, the "double list" technique seems to work great. Even if that wasn't what you meant, thanks! This'll keep my code much cleaner.
 

missile

Member
I don't think you can a reference to an unmanaged dll Visual Studio like that. But I'd love to find out I was wrong.
Then how difficult can it be to execute dumpbin /exports your.dll and utilize
its output within VS? I think Microsoft should be up to the task integrating
it into VS ;), if it isn't done already. I don't know.

I tried a bit. And it seems not possible to flag a C# project to depend on a
specific unmanaged dll. One can do a project dependency such that I can say
that my C# project depends on a, well, C/C++ one, but ... isn't what I need.
The problem is that VS compiles fine while the missing dll function will
be thrown at runtime. Having its existence checked (as an option) during
compilation would be a pretty nice move.

Another question; how to force Windows to overwrite a file while being used?
Problem is, the plugin (dll) I write will be in use by a given program, which
lets me unload the plugin but won't release its file handle. Arrgh! So I have
to reload the entire program just to test the plugin. Which sux! What I wanna
do is to unload the plugin, override the file (compiling the project) and
let the program reload the plugin again (hopefully from disk).
 

Margalis

Banned
That was a little hard to follow, but I think you're saying that instead of my unit manager having this line:

List<GameObject> squads;

Use this line instead:

List<Squad> squads;

Which I tried. The problem here is that Unity yells at me that I can't create new objects that descend from MonoBehavior using the keyword "new", I have to use AddComponent<>(). And Squad has to descend from MonoBehavior because it needs to use Instantiate to create prefab soldiers.

Something like this:

public static Soldier CreateSoldier(){
return new GameObject().AddComponent<Soldier>();
}

Or if it's a prefab you can always instantiate the prefab then return the Soldier component. Sounds like you have it basically figured out. Again, from the Component you can always get back to the gameObject with .gameObject, so you don't really need to keep track of both manually.

When or when not to use MonoBehavior is a little tricky. If you use MonoBehavior you have to be attached to a game object. I would say that if you find you need to be a MonoBehavior to call some MonoBehavior functions but doing that means creating GameObjects that you don't really want consider creating a factory class that sits on a GameObject and delegating to it.

Having a stray GameObject here and there when it logically isn't an object in the scene isn't too bad, but if you have a huge number some re-organizing might be in order.

Also Instantiate is a static method, you can call MonoBehaviour.Instantiate() from a non-MonoBehaviour class. (Not sure if there are limitations on how and when you can do that, haven't done it myself)
 

Kitbash

Member
Or are you saying have both, and just maintain the Squad list as references to the Squad components of the GameObject list?

Edit: After messing around, the "double list" technique seems to work great. Even if that wasn't what you meant, thanks! This'll keep my code much cleaner.

You'll probably find you don't need a separate list of Squad GameObjects. Here's how I handle this sort of thing:

Code:
GameObject squadContainer; // for keeping the Hierarchy window organized

List<Squad> squadList = new List<Squad>();
GameObject  squadGO   = (GameObject)GameObject.Instantiate(squadPrefab);
Squad       squad     = squadGO.GetComponent<Squad>();

squad.transform.parent = squadContainer.transform; // just to keep things tidy!
squadList.Add(squad);

Once you have a list of Squads, you can easily access things like squad.gameObject or squad.transform without any tricks.
 

Feep

Banned
Something like this:

public static Soldier CreateSoldier(){
return new GameObject().AddComponent<Soldier>();
}

Or if it's a prefab you can always instantiate the prefab then return the Soldier component. Sounds like you have it basically figured out. Again, from the Component you can always get back to the gameObject with .gameObject, so you don't really need to keep track of both manually.

When or when not to use MonoBehavior is a little tricky. If you use MonoBehavior you have to be attached to a game object. I would say that if you find you need to be a MonoBehavior to call some MonoBehavior functions but doing that means creating GameObjects that you don't really want consider creating a factory class that sits on a GameObject and delegating to it.

Having a stray GameObject here and there when it logically isn't an object in the scene isn't too bad, but if you have a huge number some re-organizing might be in order.

Also Instantiate is a static method, you can call MonoBehaviour.Instantiate() from a non-MonoBehaviour class. (Not sure if there are limitations on how and when you can do that, haven't done it myself)
That makes sense, but how can I get away with not maintaining a separate list of the GameObjects themselves? You said you can "go backward" from the component to the GameObject (to modify stuff like transform or whatever). Is that just through clever naming and using GameObject.Find()?

Edit: Same question to Kit! Should I just add GameObject and Transform objects to the Squad class, which keep references to its own container?
 

Margalis

Banned
soldier.gameObject

Every MonoBehaviour has a gameObject field that is set to the owner gameObject. You can also access transform directly without going through the parent gameObject.

Edit: Oddly this isn't listed in the MonoBehaviour API.

Edit2: To clarify the above, the transform field as well as a bunch of other fields proxy to the actual component on the gameObject.
 
Something like this:

Also Instantiate is a static method, you can call MonoBehaviour.Instantiate() from a non-MonoBehaviour class. (Not sure if there are limitations on how and when you can do that, haven't done it myself)


this is what we've been doing and we haven't run into any problems. I use a factory class to instantiate entities, attach the script, and add the script instance to the appropriate lists. For our small game you can then access all the level data via a static method, so you could type eg. World.Level.Squads[n].getSoldiers() to get a list of all the soldiers in a particular squad. We store a reference to the gameObject in the class and that way it does not need to extend Monobehaviour.
 

Feep

Banned
soldier.gameObject

Every MonoBehaviour has a gameObject field that is set to the owner gameObject. You can also access transform directly without going through the parent gameObject.
Whatttt. Mind blown.

Edit: All cleaned up! I may make a factory class as you guys suggested to clean it up even further (see below, it'd be nice to have a static AddSoldier method), but everything is much nicer now. Thanks everyone!

Code:
soldiers.Add(((GameObject)Instantiate(Resources.Load("soldier"), startPos, startAngle)).GetComponent<Soldier>());
soldiers[soldiers.Count - 1].gameObject.name = "Soldier " + (soldiers.Count - 1);
soldiers[soldiers.Count - 1].gameObject.transform.parent = transform;
 

Margalis

Banned
You don't need the .gameObject in those last two lines, name and transform are both fields on a monobehaviour that proxy to the parent gameObject. Not a big deal but it is nice to not have to spam .gameObject everywhere.
 

Tiu Neo

Member
Hey, many thanks! Got it working on first try. Just need to find out about
Marshaling & Co. But for one I can't import the dll via the C# Reference
Manager for looking at all the exporting functions in there, since it isn't a
COM file or whatever is needed here. Is there a method associating a dll file
within a C# project such that I can browse all the exported functions?

I don't think you can a reference to an unmanaged dll Visual Studio like that. But I'd love to find out I was wrong.

For unmanaged C++... Not that I know of, sorry. You'll probably have to import them, using DLLImport, on a "what I need now" basis, or at least that's what I do normally.

Maybe you could try creating a managed C++ wrapper project, and reference your unmanaged project there? I'm not sure if it will work, I never tried that, but it SOUNDS like something that could work at least for Intellisense.


Hey, great! One more reason to learn Unity. From the little I used of it, looks pretty easy and powerful.
 

billsmugs

Member

I'm not interested in iOS/Android development, but hopefully this means PlayStation Mobile export will also be free when it releases. (They say "additional mobile platforms like BlackBerry and Windows Phone 8 will also be free to publish for once Unity support is released.")

It's odd that this news isn't on the Unity website. The "Buy Unity" page is down at the moment, so I assume they're setting things up.
EDIT:It's there now!
 

sky

Member

Fuuuuuuuuuuuu!

This is big news, even though it's just the basic versions of their mobile addons.
Unity was already hugely successful among smaller developers... now it's popularly is going to explooooode. It's a smart move.

The downside of course, is people who bought the licenses already feeling a bit burned. But that's bound to happen. The plus side is people will be able to update to the latest version of Unity and enjoy the benefits of that, rather than being tied to an older one because of their addons (3.x, etc). Assuming things they are using still work, of course.

Also: dat popped collar.
 

JulianImp

Member

I was just looking to buying the free licenses, and all I can say is BRING IT ON!

I really should stop being busy so I can work more on my current joint game project, but as of late I've been nearly unable to do nearly anything at all. I guess this helps us design the game better so I don't have to recode stuff to fit new features as we come up with them, but it still makes me feel bad since I really want to get a worthy prototype up and running. I even have a few algorithms ready that I've been able to implement due to being busy with other stuff...
 

AlexM

Member
For some reasons I have to use an interface (class library) covered in a C#
dll to enhance a certain program with a plugin. I already wrote a small plugin
using the given interface. (Btw; I wrote my first C# lines, yesterday. And I
don't won't to write much more.) My question is, does there exist a native
interface from which I can call C or C++ functions? Am an entire n00b within
this regard. My situation is as follows;
Visual Studio 2012:
- a project in C/C++ (software renderer)
- a C# class library (plugin)

I just want to call the C/C++ methods from C#. Does anyone have any
experience with such a setup and knows some of the oddities involved?

look up C# interop. C/C++ interop is built directly into the language.

EDIT: My bad, already answered

I'm pretty sure this has been asked multiple times but can't find the answers in the thread. Any good page for free music and sound effects?

I really would like a cue about that too. I am in dire need of "videogamey" sound effects.


for sound effects

www.freesound.org

for music

jamendo.com
http://indiegamemusic.com/

within a C# project such that I can browse all the exported functions?

wouldnt that be impossible since unlike c#, c++ dll's dont contain meta data about their contents?
 

missile

Member
look up C# interop. C/C++ interop is built directly into the language.

EDIT: My bad, already answered ...
Nevertheless, I found an interesting article which answers one of my next
question while looking up "C# interop. C/C++ interop" on Google, i.e.
"C# Native Interop: Methods and Performance". :)

... wouldnt that be impossible since unlike c#, c++ dll's dont contain meta data about their contents?

Indeed, but like I said, one could at least check for the existence of
the function in question by using a tool like dumpbin. Stated otherwise;

Given

Code:
[DllImport("my.dll", CallingConvention = CallingConvention.Cdecl)]
public static extern void C_Function(...);

then the C# compiler has everything needed to check for the existence of the
function C_Function within my.dll (if available). Well, I don't know nothing
about Windows DLL import within C#, but there might be an option somewhere,
because it's a no-brainer to ask for such an option within this regard. For
example, given a huge program, you might just write the DLL-imported
function's name wrong. You will only find out during runtime, which sucks.
 

Tiu Neo

Member
Nevertheless, I found an interesting article which answers one of my next
question while looking up "C# interop. C/C++ interop" on Google, i.e.
"C# Native Interop: Methods and Performance". :)



Indeed, but like I said, one could at least check for the existence of
the function in question by using a tool like dumpbin. Stated otherwise;

Given

Code:
[DllImport("my.dll", CallingConvention = CallingConvention.Cdecl)]
public static extern void C_Function(...);

then the C# compiler has everything needed to check for the existence of the
function C_Function within my.dll (if available). Well, I don't know nothing
about Windows DLL import within C#, but there might be an option somewhere,
because it's a no-brainer to ask for such an option within this regard. For
example, given a huge program, you might just write the DLL-imported
function's name wrong. You will only find out during runtime, which sucks.

Maybe that can help you? http://stackoverflow.com/questions/3771648/generate-c-sharp-dllimport-declarations-from-a-native-dll

I can't test it right now, since I'm on Linux, but seems like something similar to what you want.
 

Blizzard

Banned
Is the iOS and Android license not very useful without Unity Pro (or iOS/Android Unity Pro or whatnot)? Like Rift DLL interaction not working without Unity Pro?
 
Status
Not open for further replies.
Top Bottom