Author Topic: What features to cut for round 2  (Read 20535 times)

Offline Draco18s

  • Resident Velociraptor
  • Core Member Mark V
  • *****
  • Posts: 4,251
Re: What features to cut for round 2
« Reply #90 on: November 10, 2016, 02:47:51 pm »
Here's waiting for the first bitcoin miner to be found in a mod for some game.  (It probably has already happened, just I am not aware of it).

Not worth it.  For two reasons:
1) all the easy coins have already been found
2) people tend not to run 400 instances of the game 24/7
But humorous.

Offline Sizzle

  • Full Member Mark II
  • ***
  • Posts: 189
Re: What features to cut for round 2
« Reply #91 on: November 10, 2016, 03:38:02 pm »
Here's waiting for the first bitcoin miner to be found in a mod for some game.  (It probably has already happened, just I am not aware of it).

Not worth it.  For two reasons:
1) all the easy coins have already been found
2) people tend not to run 400 instances of the game 24/7
But humorous.

Good, I intended it to be humorous.  :D

But as for #2, it wouldn't be that hard for a bit of C# code to spawn a bunch of threads.  You don't need to be running 400 instances of the game.   Nor does it necessarily have to keep running 24/7 -- it could just run once (ref:  http://stackoverflow.com/questions/1008886/how-to-create-a-process-that-outlives-its-parent ) -- but that's neither here nor there -- it was the humour I was after.

 

Offline WolfWhiteFire

  • Full Member Mark II
  • ***
  • Posts: 195
Re: What features to cut for round 2
« Reply #92 on: November 10, 2016, 04:02:28 pm »
Well having mods that can be dangerous kind of reduces the appeal to me personally. Maybe other people would be more willing to take that risk, or maybe it might be safer to only download mods a ton of people have downloaded that have also been out a fair amount of time since people would likely report the problem.

Offline keith.lamothe

  • Arcen Games Staff
  • Arcen Staff
  • Zenith Council Member Mark III
  • *****
  • Posts: 19,505
Re: What features to cut for round 2
« Reply #93 on: November 10, 2016, 04:05:47 pm »
Well having mods that can be dangerous kind of reduces the appeal to me personally. Maybe other people would be more willing to take that risk, or maybe it might be safer to only download mods a ton of people have downloaded that have also been out a fair amount of time since people would likely report the problem.
Yea, the idea is basically "would you run an application from this modder?" If not, then don't run a mod from them either.

That said, pure xml mods would be pretty safe.
Have ideas or bug reports for one of our games? Mantis for Suggestions and Bug Reports. Thanks for helping to make our games better!

Offline Tridus

  • Master Member
  • *****
  • Posts: 1,305
  • I'm going to do what I do best: lecture her!
Re: What features to cut for round 2
« Reply #94 on: November 10, 2016, 04:20:19 pm »
That was my hunch as well, having being in mods for a lot of games.  GTA V is a much better target for malicious mods if someone wants to do one.   In those cases it's often injecting arbitrary code so that it can then load custom models and behaviors and whatnot, too.  Goodness only knows what is going on with some of those Skyrim mods. ;)

Skyrim's mods are actually locked down in terms of what they can do, so they can't just do anything on your system willy nilly. Skyrim Script Extender exists to remove some of those limitations and let them do more. That's especially true for the ones that work on the console versions, since the console makers are not cool with "downloads that can do anything".

C# applications can do the same thing, by using things like code access security or using System.Addin to load the external assembly in another AppDomain with more limited security permissions.

Just saying "we'll run anything you give us with no regard for security whatsoever" is not the recommended method of doing things.
« Last Edit: November 10, 2016, 04:22:04 pm by Tridus »

Offline Draco18s

  • Resident Velociraptor
  • Core Member Mark V
  • *****
  • Posts: 4,251
Re: What features to cut for round 2
« Reply #95 on: November 10, 2016, 04:23:53 pm »
Having the power of dll mods would be very awesome.  No individual would have to use them, but it opens up a whole slew of things people would be able to do because XML can't do everything.

In terms of design: do XML where possible.  Where not possible, add API hooks.

Offline x4000

  • Chris McElligott Park, Arcen Founder and Lead Dev
  • Arcen Staff
  • Zenith Council Member Mark III
  • *****
  • Posts: 31,651
Re: What features to cut for round 2
« Reply #96 on: November 11, 2016, 11:33:25 am »
Huh!  That is fascinating on System.Addin.  I'm not sure when that was added, but I'm pretty sure it's not in the version of mono we're using.

Interestingly, loading them in app domains with lower security profiles does make a ton of sense and is something that should work here -- that was in .NET 1.0 even, and it's just been so many years (and me never having to use it) that I forgot about it.  But yeah, we ought to actually be able to just say "load these in an appdomain that is super restrictive" and that would be the end of it.
Have ideas or bug reports for one of our games?  Mantis for Suggestions and Bug Reports. Thanks for helping to make our games better!

Offline Draco18s

  • Resident Velociraptor
  • Core Member Mark V
  • *****
  • Posts: 4,251
Re: What features to cut for round 2
« Reply #97 on: November 11, 2016, 12:27:28 pm »
Huh!  That is fascinating on System.Addin.  I'm not sure when that was added, but I'm pretty sure it's not in the version of mono we're using.

Reminds me of a Thing I tried to do once only to find out Unity uses .NET 3.5 and the feature I wanted was from .NET 4 (generics with covariance and contravariance).

Offline x4000

  • Chris McElligott Park, Arcen Founder and Lead Dev
  • Arcen Staff
  • Zenith Council Member Mark III
  • *****
  • Posts: 31,651
Re: What features to cut for round 2
« Reply #98 on: November 11, 2016, 12:38:50 pm »
Huh!  That is fascinating on System.Addin.  I'm not sure when that was added, but I'm pretty sure it's not in the version of mono we're using.

Reminds me of a Thing I tried to do once only to find out Unity uses .NET 3.5 and the feature I wanted was from .NET 4 (generics with covariance and contravariance).

It's hard to even know what unity supports.  They're using Mono 2.x, whatever that means in terms of direct correlation.  It's close to .NET 3.5, but not fully there.

Heck, .NET 3.5 is still to me "new stuff" in some way, and I have a mistrust of LINQ and view generics as this semi-new thing.  I feel like an old fogey now, but I came into .NET when it was just finishing up beta, and struggled through the painful C# 1.0 period.  The 2.0 revolution that added generics and so on was like a magic gift that I still somehow don't think of as having been around for a long time.  Anonymous methods and even moreso the var keyword and default parameter values are like some sort of black magic to me.  It takes me a while to trust them, because I always have to check heap stasis and I typically want to know if it has the same sort of overhead that virtual methods do versus abstract or standard ones, etc.

Can you believe I still cringe at the extra slight processing of virtual methods?  That was relevant in the very early 2000s when a processor was single core and 800Mhz, but even then it was a little on the fussy side (to put it mildly).  Now it's just a ridiculous thing to even consider, but old habits like that die hard.  :P
Have ideas or bug reports for one of our games?  Mantis for Suggestions and Bug Reports. Thanks for helping to make our games better!

Offline Draco18s

  • Resident Velociraptor
  • Core Member Mark V
  • *****
  • Posts: 4,251
Re: What features to cut for round 2
« Reply #99 on: November 11, 2016, 02:21:38 pm »
I feel like an old fogey now, but I came into .NET when it was just finishing up beta, and struggled through the painful C# 1.0 period.  The 2.0 revolution that added generics and so on was like a magic gift that I still somehow don't think of as having been around for a long time.  Anonymous methods and even moreso the var keyword and default parameter values are like some sort of black magic to me.

Haha. Too true.
I've gotten the hang of most of it due to having been in Javaland for a while (and in some respects, having to deal with it because Forge Said So).
But it's ungodly super awesome.

This being one of the things that Forge did that made everyone happy (once people realized what it was and how it worked):
Code: [Select]
public <T> T getCapability(Capability<T> capability, EnumFacing sideAccessed) {
//...
}

The Capability<T> bit is basically a way to say "I'm passing in a reference type, if you deal with that type, give me that object instance."  No more "TileEntity MyThing implements IInventory ISidedInventory IEnergyProvider IRedPowerProvider IMechanicalSupplier IUniversalPowerAdapter...." Nope, no more "god object," it's all capabilities now.

If the object doesn't have the requested capability, return null (or rather, return super.getCapability, so you're not accidentally skipping any provided by a super-class!).  If it does, return it.

Offline x4000

  • Chris McElligott Park, Arcen Founder and Lead Dev
  • Arcen Staff
  • Zenith Council Member Mark III
  • *****
  • Posts: 31,651
Re: What features to cut for round 2
« Reply #100 on: November 11, 2016, 02:38:39 pm »
Keith added a ton of new things kind of along those lines, too.  Extension methods for enum values, which was nutsy to me and so awesome.  We still do typical inheritance most of the time, but thanks to a lot of unity asset store assets I've picked up some new tricks and habits such as extending a variety of classes built into unity and putting on my own methods to them so that I can do things quicker.  No more calls to Mat.Whatever in our own internal math library, at least for some things.
Have ideas or bug reports for one of our games?  Mantis for Suggestions and Bug Reports. Thanks for helping to make our games better!

Offline Draco18s

  • Resident Velociraptor
  • Core Member Mark V
  • *****
  • Posts: 4,251
Re: What features to cut for round 2
« Reply #101 on: November 11, 2016, 02:50:05 pm »
Mhm.
The idea of generic capabilities is awesome for mods, though.  Especially if you want two mods to be able to interact with each other, which so often in Minecraft they do.

What I was trying to do in Unity was basically just events.  Being able to store function references and when the event occurred, call the method.  I didn't like the C# way of doing things and eventually hacked my way to a solution I was mostly happy with (delegates were too strict for my purposes).

Offline x4000

  • Chris McElligott Park, Arcen Founder and Lead Dev
  • Arcen Staff
  • Zenith Council Member Mark III
  • *****
  • Posts: 31,651
Re: What features to cut for round 2
« Reply #102 on: November 11, 2016, 04:07:25 pm »
Got it.  I notice that unity also has the SendMessage thing that allows you to call a method by name on any MonoBehaviors in a tree of objects.  I kinda like that (reminds me of the underlying old win32 messaging process, but a little more modern), but I'm not sure how exactly they're doing it.  Is it in-situ reflection?  Is it precompiled?  Is it based on some sort of hashing dictionary?

Overall without knowing those things, I tend to avoid that tool because I don't trust the efficiency.
Have ideas or bug reports for one of our games?  Mantis for Suggestions and Bug Reports. Thanks for helping to make our games better!

Offline jenya

  • Newbie Mark III
  • *
  • Posts: 41
Re: What features to cut for round 2
« Reply #103 on: November 11, 2016, 05:23:33 pm »
sendmessage, quick google scan says this is reflection and could be bad
https://www.sebaslab.com/whats-wrong-with-sendmessage-and-broadcastmessage-and-what-to-do-about-it/

Offline Draco18s

  • Resident Velociraptor
  • Core Member Mark V
  • *****
  • Posts: 4,251
Re: What features to cut for round 2
« Reply #104 on: November 11, 2016, 05:27:01 pm »
Yeah, its reflection, and comes with the associated costs.
Heck, even unity's "build in" methods (start, update, etc) are invoked via reflection (how's THAT for efficient code?)