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 - Adil

#1
Help / Re: Help with bed ownership
June 05, 2019, 02:13:37 PM
I believe this behavior is hardcoded into <thingClass>Building_Bed</thingClass>. You need to do C# coding to create anything else with similar behavior.
#2
Releases / Re: [1.0] A RimWorld of Magic
May 14, 2019, 04:41:16 AM
To answer my own question: mages (not fighters) have hardcoded 40% chance to go boom on being downed.
Then there's also the undocumented "hard mode" setting. One thing it does, is setting enemy spell effect modifiers to 4 regardless of the mage levels and training. It seems that highest normally achievable value is 3.5. Spells which power cannot be expressed by a single modifier, undergo equivalent transformations.
And secondly, the hardmode sets death chance of the downed mages to 100%. 

If you tick this setting off, you might not notice the change at first, because they still have 40% chance of sudden death.
#3
Releases / Re: [1.0] A RimWorld of Magic
May 13, 2019, 09:23:38 PM
Quote from: Canute on April 26, 2019, 04:06:48 PM
This got added to made mages more dangerous.
The AI use spells much less effectiv then you, so mage explode when they die.
Downed mage shouldn't explode.
But if you don't like this you can disable it at the mod options.
How do you do that? Nothing in the options mentions the death on down. And few ticks I've ticked didn't seem to have effect on that.
#4
Help / Re: Misc Spots placement handlers
February 11, 2019, 10:41:52 AM
They don't have placeworker, but they have their own classes. For example:     <thingClass>Building_MarriageSpot</thingClass> for wedding spot. You can look what that class does in decompiled code.

A simple example of how that can be handled is the trading spot mod: https://github.com/KiameV/rimworld-tradingspot/blob/master/Source/TradingSpot.cs#L17
#5
Releases / Re: [1.0] No Job Authors
February 04, 2019, 07:44:26 PM
This one needs a better spotlight. It is really a shame that this one is getting lost in the crowd. It is sometimes useful.
At least put something like "remake of Finish The Damn Thing" in title or mention it in the OP, maybe then this thread will be findable through google.
#6
Releases / Re: [B18] Assign Prisoner Beds
February 03, 2019, 10:54:03 AM
Oh, hi!
I it seems that Tynan desided to rename one method which was used by this mod.
I've updated it:
version_1.something
I'm currently not capable of doing much more work on this, but maybe eventually it will go on steam.
#7
Mods / Re: quasi-cannibalism questions
July 22, 2018, 06:27:02 PM
Quote from: AllisonIsLivid on July 21, 2018, 01:33:39 AM
Honestly, I can't even find where human meat is stored in the documentation
There's no documentation. The behavior of human meat is defined in the mishmash of the hardcoded info and a bit of fleshtype defs.
I googled up decompiled code to answer. Do not use my comments on the code to write an article about Tynan being cannibalism proponent :P .

The game checks meat source race for its intelligence. If inside race def there is this passage:
<race>
      <intelligence>Humanlike</intelligence>
...

it probably should consider it immoral.

However, same flag is checked to determine what can they be trained to do (and explosions fleeing). I'm unable to answer whether that will affect their training. Also, many needs seem to define <minIntelligence>Humanlike</minIntelligence> for them to appear.


Other than setting intelligence or using <useMeatFrom> tag in race def, there are also fleshtypes. They are also used to attach thoughts to eating (see Misc/FleshTypeDefs/FleshType.xml):
<FleshTypeDef>
    <defName>Insectoid</defName>
    <ateDirect>AteInsectMeatDirect</ateDirect>
    <ateAsIngredient>AteInsectMeatAsIngredient</ateAsIngredient>

The last line listed references thought def from ThoughtDefs/Thoughts_Memory_Eating.xml .
This way however the meat is likely to be allowed by default in the stockpiles and workshops.
#8
Help / Re: Optimizations of frequently called checks
January 27, 2018, 03:22:27 PM
The harmony is not the point of the question. Yes, a function attached by harmony is called every time after the function that it is attached to. That's the entire point of a patch.

Here, I've used harmony patch to indicate that the core game function GetGizmos is called multiple times per second for the same object without any actual need to.

I'm not quite familiar with c# but I do know some languages' compilers can detect redundant calls and optimize them away. And in some cases input\output operations are treated as a reason not to optimize the encompassing fucntion in such way.

So the question 1 was: Did I break rimworld optimizations by injecting the i/o-operations or is it always needlessly regenerating all the objects each frame?

The question 2 is: How would one optimize these calls so that they do not do much work when nothing changes? I do know people tend to just set functions to be called on certain ticks only, but is there any common way to do caching for example?
#9
Help / Optimizations of frequently called checks
January 27, 2018, 07:29:25 AM
I've been playing around with buttons recently. I've added the following harmony patch to the game:
           
static class Building_Bed_GetGizmos_Patch
{
  static void Postfix(ref IEnumerable<Gizmo> __result, ref Building_Bed __instance)
  {
      Log.Message("Prisoner bed patch run ")
  ...
  }
}

This code is run every time after the vanilla GetGizmos is performed on a building.
With the code above, one gets a single log message on every tick even if nothing happens to the building (even on pause).

Is it presence of Log.Message() that forces function rerun, or is it vanilla behavior to rerun all the checks regardless of absence of change?

The code in question was quite short and checks were simple, so not much time is lost there, probably.  Not in this particular case but, say, in PawnCapacityWorker (or JobGiver or Comp) routines some more complex calculations may be desired, and those seem to get called often too.
What would be optimization tricks for those?
#10
Releases / [1.0] Assign Prisoner Beds
January 26, 2018, 09:36:52 PM
This mod reuses code from animal logic to add "assign owner" button to prison beds. This should allow moving prisoners from cell to cell.



There are still problems with it however.

If a prisoner cannot reach the assigned bed on his own but can reach another free prison bed, he will switch ownership to the latter.  Also, if prisoner is in bed already and cannot reach the new bed any assignments will be cancelled.

This is actually vanilla behavior for all colony pawns. Wardens sometimes move prisoners to their assigned rooms. Or if you allow prisoner to wander outside his cell, then you can use drafted colonists to arrest them into new bed.



To improve that behavior, one will have to plunge rather deep into vanilla behavior code. I currently lack and am unlikely to obtain such knowledge anytime soon. Still in its current state, the using the mod seems to be more convenient than vanilla tricks for moving prisoners. So I'm calling this a release. If someone is willing to finish the job, you have my blessing.



Download link
google drive
googleDrive_b18

mod requires hugslib.



[attachment deleted by admin: too old]
#11
Ideas / Re: The Combat is Too 'rushy'
November 27, 2013, 06:55:54 PM
What troubles me more is the way they charge in room filled with armed colonist and start running all over the place like scared deer in a bus while your guys are still aiming the shots.

The combat needs something like overwatch mode so that a person that enters it spends some time preparing but the next shot in a specified direction costs him quarter of it's usual time.
The AI would need to be updated not to rush in blindly then, though.
This also could help somewhat with the initial rush since snipers could get more than a single shot at charging enemies.

That and some eventual balncing of weapons should be fine.
#12
Ideas / Re: Your Cheapest Ideas
November 13, 2013, 03:17:53 PM
1. Allow food to be taken back from storage area. It a bit silly when people starve because of lack of electricity.
Or add a dumpzone variant that accepts food.

2. Ability to disallow debris from dumpzones. Some of them are meant for corpses only.

3. Color names of drafted people in the overview screen.

4. Notification about fighting\hurt people.

5. Ability to change to which conduit lamps, turrets and dispenser are connected.

6. Have idlers wander around home zones instead of any construction on the map.