Menu

Show posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.

Show posts Menu

Messages - TehJoE

#1
Quote from: bullet on February 24, 2015, 06:36:32 PM
after I made a small factory like in attachment
I started to have a stable lags (freezing every 1-2 seconds on max speed)  :'(

Are there any errors in the console? I don't know if Alpha 9 fixed it or not, but in Alpha 8 I personally had troubles with a lot of construction designations on the map at once causing the freezing you describe. Are you sure that's not going on? If not, try cutting the power to the belts and see if the lag stops. Let me know what you find.
#2
Quote from: Rock5 on February 24, 2015, 01:45:34 PM

I'm all for it but every time I've approached languages like c# I've found them too difficult. Even now when I look into mod dlls I'm finding it too hard to get started. It doesn't help that there doesn't seem to be any documentation or guides anywhere. And by guides I mean guides that explain things step by step, not "copy and paste this, compile and you've made your first dll". Or even a references that explains the different values in xmls.

What I'd like to see are separate guides for different features of mod making. For instance a step by step guide to make simple xml mods such as making item, recipes, research etc. There probably are some of those. But then also a guide to add a button to an item, a guide to adding a comp to something (is that what they are called?), a guide to adding a process that runs every tick. I just look at everything and I don't know where to start. It doesn't help that c# isn't like languages I've dealt with before and I've never dealt with dlls before. I sort of understand that dll probably define some classes or objects that are then referenced in the xmls but that's about all I understand.

Yeah so if you have some advice on how I can start learning this stuff I'm all ears.

Unfortunately a lot of this stuff is still heavily undocumented, especially with changes between Alphas breaking and outdating certain things... The best advice I can give you to figuring out how to do C# dll modding in RimWorld is to download JetBrains' dotPeek decompiler and use it to browse RimWorld's Assembly-CSharp.dll and the dlls of other mods that interest you, and browse open-source mods' source code. (Just don't steal others' work!) C# is really not all that hard to understand compared to some other languages, it just takes some practice. Programming is a highly sought-after skill for a reason though - don't expect everything to come easily!

Basically, play with code, make things, break things, change things, and you'll develop an understanding of how it all works. Haplo's example PowerGeneration mod is a good start if you read the comments inside the source code - it explains several things that will have you well on your way to making mods.

And you're pretty much right about what a dll file is - it's a file containing a bunch of classes that all talk about each other and do a whole bunch of things, and sometimes reference the classes in other dll files. The main .exe file usually loads all the classes in those dlls and puts them to work.
#3
Quote from: Rock5 on February 24, 2015, 03:29:40 AM
Definitely good ides from Famous Shoes.


       
  • 1-5. Even though, yes, the teleporter can provide these functions, I like the idea of a low tech solution. Seems over the top to have a high tech device like a teleporter just to move an item a couple of squares. I particularly like the underground idea, although I don't know if thats possible. Can you have a 1x3 construction that is impassible on the ends but passable in the middle? But if it was possible you could use it to allow people to pass, to cross walls and even to have crossed belts. So multiple uses. In fact I'd probably prefer that than the teleporter which, I agree with Famous Shoes, is a bit off-lore. If people want a teleporter it's probably better off as a separate mod.

I don't think it's possible to mix passability and impassability like that... There is still the very real problem of rendering order which is actually not trivial to change. As much code as I've written for this mod so far, the entire process of rendering items on the belt is still magic to me. I've been considering a "crossover" component to let belts cross but I'm not sure it's got enough uses to be an entire component. And for me personally, the overkill of using teleporters to break up conveyor belts is part of the charm of the mod ;)

Quote from: Rock5 on February 24, 2015, 03:29:40 AM

       
  • 4. People are talking about item deterioration on the belt but I think nothing deteriorates on the belt. Correct me if I'm wrong.

Beyond weird edge cases like completely-surrounded belts becoming "outdoors" (a problem that will be fixed in the next release), items should only deteriorate on belts if they would have deteriorated in that cell otherwise, i.e. the belts don't affect item deterioration at all.

Quote from: Rock5 on February 24, 2015, 03:29:40 AM

       
  • 8. Items jam already don't they? That annoys me I admit but I like the idea of items occasionally falling off, hopefully not too often.

They should not. If you have any situations that produce jams in v0.9.0+, please submit a bug report on github.

Quote from: Rock5 on February 24, 2015, 03:29:40 AM

       
  • 9. Not sure I follow that but to save power how about an unpowered belt? Items wont move forward unless pushed from behind? I'm not sure how many people would find a use for it though and be happy to have a belt full of items they can't reach.

I don't know about you guys but power is basically free in this game so far. I don't see a strong utility for unpowered push-only belts. Maybe a fall-back feature for the base belts when their power is cut, but I wouldn't count on it...

Quote from: Rock5 on February 24, 2015, 03:29:40 AM

       
  • 10. I have to second that facepalm. It's definitely a nice solution to have 1 go straight and 2 go left or right depending on what's connected. Acting as a splitter too is just a bonus. It's simpler than my suggestion of somehow sensing what sides are connected and adjusting accordingly, which would be hard to program and confusing to users.

"Hard to program"?  That a challenge? 8)

Anyway, all components already sense connected sides and only send to those if that's what you mean. If we still had any non-symmetrical components I would actually consider putting some mode-toggle buttons in for some of them. A symmetrical selector is in the next release.

Quote from: Rock5 on February 24, 2015, 03:29:40 AM

       
  • 12. Another brilliant idea. Definitely belong in another mod. If I had the skill I'd jump on that project right away.

Skill isn't something you just have, it's something you create yourself. So if you have a project you want to see happen, make it happen  ;)
#4
Quote from: Famous Shoes on February 23, 2015, 03:53:16 PM

  • Step overs: either a step over one can place over an existing conveyor (likely impossible) or just a straight conveyor segment with an integrated step over. See: http://www.gmhgb.com/images/stepovers.jpg
  • Doors: straight conveyor segments with a door to block heat and item movement (toggle open and shut, automatically close on power-loss), e.g., for conveying items into a large freezer. Auto-open and close when items are passing through might also be nice. See: http://www.expo21xx.com/news/wp-content/uploads/albany-conveyor-system-door.jpg
  • Overhead segments: to allow pawns to walk under, perhaps restrict them from conveying heavy items, e.g., chunks, large corpses.
  • Covered segments for the outdoors: counts as indoors for item degradation, perhaps restrict them from conveying large items, e.g., chunks, large corpses.
  • Automatic power control: when built inline with the power source a conveyor system or perhaps just adjacent to any part of the system, switches power off automatically in response to: the system being empty or no items can move.

I am actually a huge fan of having some kind of sealable conveyor belt. I have a hunch, though, that I can do it without even adding another component, since building things into walls is actually already supported in the game. As for passable belts, well, until an issue with temperature equalization gets sorted out, that will be technically possible (though your pawns will still try their damnedest to go around). I think a step-over would actually look really neat and so would the overhead belts, but there's actually a quirk in rendering where I'm not 100% sure the step-over could be rendered above the items passing under the belt but below the pawns crossing it. Similarly, I don't know if we can get belts to render above pawns entirely but below items. Not to mention they add components for a single purpose, something we're very wary about doing. Covered outdoor segments have the same single-use component issue, and it's trivial to build a few walls to roof in your conveyor belts especially since if they're particularly long you really should be using a teleporter somewhere anyway.

As far as automatic power control goes, I've actually felt for a while that this mod community is just awaiting their wiremod/redstone/etc equivalent for rimworld before the really great mods start emerging - if someone were to implement a logic-transmission mod (perhaps TYNAN ;D), I imagine we would almost certainly have some kind of "item detector" component or similar to interface with it.
#5
Quote from: dareddevil7 on February 22, 2015, 09:08:41 PM
do they still cut entire rooms in half?

Assuming you're talking about sealing rooms off like walls: In 0.9.0, they can in some cases, but the upcoming 0.9.1 version fixes that completely.

They're not intended to be pathable (you can use teleporters to split the belts up to allow pawns through) but in the next release I believe you technically can get a pawn to walk through them if it's absolutely the only way to get somewhere.
#6
Help / Re: Impassable, but allow temperature through
February 20, 2015, 11:37:31 AM
Just in case anyone else is looking for a solution to this problem or something similar, I'm gonna detail how I ended up fixing it:

Looking through the pathing code in dotPeek, I noticed this snippet here that signals whether a cell is walkable or not (i.e. a Pawn is allowed to walk through it when finding a path to another cell):


public bool Walkable(IntVec3 loc)
    {
      if (!GenGrid.InBounds(loc))
        return false;
      return this.pathGrid[CellIndices.CellToIndex(loc)] < 10000;
    }


And the pathGrid array is updated by this:


public void RecalculatePerceivedPathCostAt(IntVec3 c)
    {
      if (!GenGrid.InBounds(c))
        return;
      this.pathGrid[CellIndices.CellToIndex(c)] = PathGrid.CalculatedCostAt(c, true);
    }


Which calls a rather long function (that I've trimmed for brevity) to calculate the path cost of a given cell:


public static int CalculatedCostAt(IntVec3 c, bool perceived)
    {
      (...)
      List<Thing> list1 = Find.ThingGrid.ThingsListAt(c);
      for (int index = 0; index < list1.Count; ++index)
      {
        if (list1[index].def.passability == Traversability.Impassable)
          return 10001;
        num3 += list1[index].def.pathCost;
      }
      (...)
    }


As you can see, an Impassable Thing gets its unpathable property from the fact that this function returns a path cost of 10001, one more than the threshold that Walkable(loc) deems unpathable. So I changed my building's def to:

<passability>Impassable</passability>
<passability>PassThroughOnly</passability>
<pathCost>10001</pathCost>


And now my building lets temperature pass through it as if it weren't there, without hacky door mechanics and room checking, but a Pawn completely surrounded by them is unable to escape. Hope this helps someone.  ;)
#7
Help / Re: Impassable, but allow temperature through
February 19, 2015, 06:58:30 PM
I did check out that mod since I use it in my own colonies, but unfortunately their source code isn't available for viewing. The doorway technique almost works, except when my 1x1 building is tiled to an area of 3x3, the center one becomes "outdoors" (probably because its Room ceases to exist) and then it tries to equalize the temperature with the outdoors.

Perhaps a better technique would be to somehow make a Standable/PassThroughOnly building effectively Impassable?
#8
Help / Impassable, but allow temperature through
February 19, 2015, 04:29:41 PM
Is it possible (through a dll mod or otherwise) to create a building that is impassable but doesn't block temperature from equalizing through it? I have a building type that I don't want Pawns walking through but I don't want it to hermetically seal off rooms either. I've tried doing something like the door does, calculating the average temp of nearby rooms and adjusting the temperature in each to equalize it, but that doesn't work if I put two of these side-by-side. Any ideas?
#9
Quote from: Rock5 on February 16, 2015, 12:26:28 PM
For it to work properly it would have to skip trying to move the item if all the outputs are full and keep checking GetDestinationForThing until it returns a destination which should happen when an output is finally clear.

As far as I know, that's what it does:

        public void Tick()
        {
            (...)

            foreach (var thing in Contents.Where(ShouldIncreaseCounter))
            {
                _thingCounter[thing]++;
            }
        }

        private bool ShouldIncreaseCounter([NotNull] Thing thing)
        {
            (...)
            var destination = _parentComponent.GetDestinationForThing(thing);

            var belt = destination.GetBeltComponent();

            // If no belt items, then move things only if this is an unloader
            if (belt == null)
            {
                if (_parentComponent.IsUnloader())
                {
                    // If this is an unloader always increment the counter
                    return destination.CanPlaceThing(thing);
                }

                return false;
            }

            // If there is a belt, only move things if it can accept them from us
            if (!belt.CanAcceptFrom(_parentComponent))
                return false;

            return belt.Empty;
        }


But then, I've made some changes to routing code since the 0.8.1 version so this may not represent what's actually released. (I'm still tweaking a few things here and there so the version I have running on my machine is a little different from the one currently released) I'll make a note to test the splitter for the clogging issue when I test other changes.

EDIT: Just tested for and fixed the clogging issue. It turns out the splitter was being re-checked for a good destination, but the splitter wouldn't consider any others until its item changed.
#10
Quote from: Rock5 on February 16, 2015, 09:46:41 AM
Currently the way a Splitter works, I believe, is to alternate sending items to each output. If an output is blocked it sends the item to the unblocked output. This is good but... if both outputs are blocked I think it assigns the item to one of the blocked outputs anyway. Then if an output becomes free and it's not the one the splitter chose to send the item then the splitter becomes stuck until the other output clears.

I didn't write the original splitter code, but I did alter the routing code of the splitter significantly in the 0.8.1 version. The bolded is certainly the way the splitter is meant to work. I haven't personally experienced them clogging in the way you describe in 0.8.0 or 0.8.1 (I didn't actually use the 2-way splitter much), but I wouldn't be surprised if that issue was inadvertently addressed by the changes I made. If you run into the same issue in 0.8.1, let me know and I'll see if I can find what causes it.
#11
A quick example of what the 3-way mergers/splitters are capable of:



It might look like the belt structure is wasting a lot of space in that stockpile, but keep in mind the unloaders will push their items out into the stockpile once the chunks in front of them are removed, so each unloader is effectively a stockpile slot in that regard. If all the unloaders are full, the chunks will get backed up into the splitters which will still push them into the stockpile eventually, so in reality this stockpile is as big as it would've been without the belt structure!
#12
Quote from: noone on February 15, 2015, 12:48:45 AM
Disclaimer 2: there are still other issues I need to look at (https://github.com/noone57/RW_A2B/issues)
Disclaimer 3: should not say this, but I did not test the update myself. I fell victim to the 2011 MBP GPU issue, and can't run Rimworld anymore. I am forced to non-GPU demanding tasks for now, but can fix the mod "if you can tell me where the bug is" ... Run the mod at your own risk ! (this is why it is not yet announced on the main post, btw...)

To anyone who runs the mod at their own risk, please do post issues here or preferably on the GitHub page if any are encountered, and I'll see what I can do. It's not like there's a team of beta testers checking this for bugs.
#13
Yeah, this game is still in alpha. It would be surprising if an update didn't break compatibility with every mod in existence, since the base game isn't even done. Hopefully once this game goes 1.0 full release, some kind of backward compatibility can be established so we don't have the Minecraft situation where every update goes ignored by the community until the popular mods update :P

That said, this mod is the only reason I'm still playing Alpha 7 ;D
#14
Quote from: Goo Poni on December 14, 2014, 10:19:51 AM
Quote from: RubberPiggy on December 14, 2014, 10:16:35 AM
Is there any way to keep the Crematorius from cremating my hunted animals? My colonists are starving but these dead raiders are starting to smell.

You can forbid the animals while the cremators do their work on the raider bodies then draft them and send them back to the charging stations. Deactivate them there to stop them wandering around the base idly and then you can collect the game you've been hunting. Deactivating them stops whatever they were doing and stops them draining their energy.

Huh. I always forget forbidding is something I can do. Thanks for the (obvious in hindsight) tip.

As a feature suggestion for the mod, perhaps an allowed types menu similar to the butcher table would be a welcome addition to the Crematorius, if it's possible to add such a thing to a Pawn rather than a building.

Edit: Being able to attach bionic arms/legs to droids to "upgrade" them would kick several degrees of ass as well.
#15
Is there any way to keep the Crematorius from cremating my hunted animals? My colonists are starving but these dead raiders are starting to smell.