Jump to content

Help
Latest News Article

[1.2.5] Somnia [SSP|ML]

1.2.5 ssp function

1225 replies to this topic

#1

  • Location: USA
  • Minecraft: MALfunction84

Posted 12 February 2011 - 06:51 PM

*
POPULAR

Quote

True sleep passes time. It doesn't just move the sun or randomly spawn a monster. The world will go on, with or without you.
- Fake proverb
Somnia completely changes how sleeping works in Minecraft. It has been included in YogBox (with permission) and mentioned in PCGamer, which is pretty sweet.

Download
  • v24 [1.2.5] - Download (adfly) - Released Apr 15, 2012
    • Added configuration option that controls which difficulties prevent you from sleeping in armor.
Archive of previous versions:
Spoiler

Requirements
News News Archive:
Spoiler

Features
  • Simulates the world: While you're sleeping, the world continues as if you are standing idle the whole time. Crops and trees will grow, smelting continues, weather progresses, mobs are active (even mobs added by other mods), and dropped items decay. You also heal an amount based on how long you've spent sleeping and the difficulty setting, but you'll also grow hungry. The simulation will take a few moments.
  • No sleep-triggered monster spawns: Monsters spawn normally and may still attack you in your sleep, but only if they can actually reach you. No more worrying if your bed is in an "unsafe" location. If you'd be safe while awake, you'll be safe while asleep.
  • Sleep/wake at any time: Sleep any time, day or night. Wake automatically at the next dawn/dusk or manually at any time. If you have a Clock item in your hand, you can choose when you wake from among 16 options throughout the day.
  • Control your spawn point: Before you sleep, you can choose whether or not sleeping will reset your spawn point.
  • Maximum compatibility: This mod doesn't add any new Block or Item IDs. It just changes the behavior of the native bed. It will not corrupt your save files, and it is compatible with most other mods. It also disables itself in multiplayer.

Screenshots
Spoiler

Videos
Spoiler

Installation
ModLoader only:
  • Download ModLoader and install it into your minecraft.jar file.
  • Run Minecraft and make sure it still works. If not, reinstall ModLoader and make sure you didn't miss any steps (like removing the META-INF folder).
  • Copy the contents the Somnia ZIP into your minecraft.jar file.
  • Enjoy!

ModLoader + Minecraft Forge:
  • Download ModLoader and Minecraft Forge and install both into your minecraft.jar file.
  • Run Minecraft and make sure it still works. If not, reinstall ModLoader and Minecraft Forge and make sure you didn't miss any steps (like removing the META-INF folder).
  • Copy the Somnia ZIP into .minecraft/mods.
  • Enjoy!

Configuration
The first time you run Minecraft with Somnia installed, a file called mod_Somnia.cfg will appear in your .minecraft/config directory. If you want to change any of the options, open this file in a text editor. I have described each property below. To reset to the defaults, make sure Minecraft is closed, delete the file, and restart Minecraft.
  • heal.easy - The heal rate, in hearts-per-hour, while sleeping on Easy difficulty.
  • heal.normal - The heal rate, in hearts-per-hour, while sleeping on Normal difficulty.
  • heal.hard - The heal rate, in hearts-per-hour, while sleeping on Hard difficulty.
  • hunger.easy - The hunger rate, in foods-per-hour, while sleeping on Easy difficulty.
  • hunger.normal - The hunger rate, in foods-per-hour, while sleeping on Normal difficulty.
  • hunger.hard - The hunger rate, in foods-per-hour, while sleeping on Hard difficulty.
  • respawn.default - Controls the default value of the "Reset Spawn" button.
  • respawn.visible - Controls whether the "Reset Spawn" button is visible.
  • valid.worlds - Comma-separated list of world IDs that allow sleep. Normal = 0; Nether = -1; End = 1. (Doesn't work. Sorry!)
  • armor.difficulty - Minimum difficulty where armor must be taken off to sleep. 0 = Peaceful, 1 = Easy, 2 = Normal, 3 = Hard, 4 = Hardcore, 5 = Disabled.

Mod Packs Featuring Somnia
The following mod compilations include Somnia (with permission).
Mod Compatibility
This mod does not add any new block IDs, so you can safely begin using it in an existing world, and it will not corrupt your world if you remove it. If you are using ModLoader and install it into minecraft.jar, the only core file it changes is the Bed block, so it should be compatible with most other mods. If you are using Minecraft Forge, it should be compatible with any Forge mod.

Some compatibility questions involving specific mods have come up in the past, so I have addressed them here:
  • Better Than Wolves: Sleeping while a machine destroyed blocks caused an accumulation of particles in v18 and earlier which lagged the game. This is fixed in v19 and later.
  • Dynamic Lights: Sleeping while using Somnia v9 v12 and earlier will cause crashes, but I've fixed that in v10 v13 and later.
  • HD Textures: As with many mods, it may be tricky to get Somnia working with HD textures, but it is possible.
  • Millenaire: Does work with Somnia, despite some perceptions. The townsfolk don't build at night, but they do make babies.
    • Sometimes the game freezes up while sleeping and displays the message "Saving chunks." A look at ModLoader.txt reveals a ConcurrentModificationException. Other players using Millenaire have had the same problem while awake, so it's not an issue with Somnia.
  • MoreBeds+ (outdated): The creator of this mod was kind enough to modify it so it would be compatible with Somnia.
  • The Seasons Mod: When using Somnia v12 and earlier, seasons did not correctly advance when you slept. This is fixed in v13 and later.

Known Issues
  • Can take a rather long time to simulate, especially if you have a slow machine. This is likely why Mojang chose to implement sleep the way they did.
    • Update: v10 (and higher) contains an optimization that improves performance. If you're recording with FRAPS, sleeping should be much faster.
    • Update 2: This was adjusted further in v13. Autosave is completely disabled while sleeping.
    • Update 3: Performance across the board took a huge hit in Minecraft 1.8, and the simulation speed suffers as a result.
    • Update 4: Performance has improved in 1.9pre5, so I've removed the benchmarking poll for now. I will add it back later.
  • Does not work with some parts of the Doggy Talents mod. Its developer has added a workaround, but we're working to find a better solution.

FAQ
Q: I've encountered a problem with your mod. Can you help me?
A: First, consider that you might have done something incorrectly. Start with a clean minecraft.jar and go through the installation once more. Make sure you can consistently reproduce the problem. Here are a few common mistakes:
  • Make sure you installed ModLoader (and Minecraft Forge if applicable) correctly.
  • Make sure you deleted the META-INF directory from your minecraft.jar file.
  • Make sure you're installing the correct version for your version of Minecraft.
If you're still having problems, post to this thread and be sure to provide the following information:
  • Are you using the latest release of Minecraft? If not, what version?
  • Are you using the latest release of the mod? If not, what version?
  • Are you using ModLoader or Minecraft Forge?
  • What exactly is the problem? (e.g. "Black screen" or "Crash")
  • When does it happen? (e.g. "Every time I start Minecraft" or "When I sleep with a pig nearby.")
  • Do you have other mods installed? If so, which ones?
  • Is there an error or stack trace? (Check .minecraft/ModLaoder.txt near the end.)
If you don't provide all of the required information, I will not be shy about directing you back to this question.

Q: Can I include your mod in my mod pack?
A: Thank you for your interest, but no. I've given permission to the mod packs above. I will not extend this permission to any more mod packs. There are simply too many out there.

Q: Can I mirror your mod?
A: No, I would prefer that you simply link to this thread. The best thing for users is for the mod's presence to all be in one place. That way, it's a one-stop-shop for people to download the newest versions, get support, and offer suggestions.

Q: Why does the simulation take so long?
A: The simulation is a lot of number-crunching, so if you have a slow processor or are running intensive processes in the background (like frapps), it's going to take longer. There are also some design choices made by Minecraft's developers that make it impossible for me to optimize. Minecraft's code mixes graphics with logic in several places, so the simulation performs some unnecessary graphics-related operations that can't be skipped.

A number of users have reported a 10-20x speed decrease while running frapps. If you're recording a video, best to suspend recording before you sleep.

Q: Can you add a way to sleep "normally" where the simulation doesn't run?
A: This mod is more about realism than utility. An option for the "normal" bed behavior would defeat the purpose. If you want to disable the mod without uninstalling it, open .minecraft/config/ModLoader.cfg with a text editor and set mod_Somnia=off.

Q: How does Somnia work? If I'm a developer, how do I make sure my mod simulates correctly?
A: It's too complicated to explain in one or two paragraphs. Expand the spoiler for details.
Spoiler

Q: How did you come up with the idea?
A: I was interested in creating a mod (my first), so I asked a friend of mine for ideas. This was back in Beta 1.2, before there were beds at all, and he wanted a way to skip the night so he could focus on building during the day. I wanted to make sure it didn't feel like cheating, which meant preserving the risk involved with sleeping in a world full of monsters. That's where I got the idea of just simulating the world. The monsters are active while you're asleep, so if they can get to you, they will attack you. That put a new emphasis on building a solid home base, which I thought was a cool idea. Simulating the world also meant that things like smelting would continue, which would save us more time. I used this tutorial as a jumping-off point. From there, I found out about MCP and ModLoader.

It wasn't a unique idea, of course. A lot of people had similar ideas, like in this thread. When Notch added beds and sleep in 1.3, I decided to continue developing the mod and to just repurpose his bed, which looked better anyway. (The first version of Somnia added its own bed block.) Most of people's complaints about Minecraft's native sleep are because it seems so artificial. There are these arbitrary rules that don't apply any other time, so it upsets our expectations. Somnia "fixes" these by acting the way real sleep acts -- you're idle and vulnerable for a long time, and the world continues.

For those who have wondered, I didn't really have complaints against native sleep in mind when I created Somnia because at the time, there was no sleep in Minecraft. I just brought forward my own implementation, which some people preferred over the native one.

Show Support
Show your support by placing this badge in your signature:
Posted Image

[url=http://www.minecraftforum.net/topic/162771-#entry2487926][img]http://img695.imageshack.us/img695/4560/somnia.png[/img][/url]

Or make a donation:
Posted Image

Development Checklist
Spoiler

Copyright/License
Spoiler

SDG
Posted Image Simulate the world while you sleep.

Register or log in to remove.

#2

  • Location: The Nether
  • Minecraft: NightmareX91

Posted 12 February 2011 - 06:52 PM

Screenshots ingame or no download :3
Posted Image Did I help you? Click the pretty + and give me a diamond!

#3

  • Location: USA
  • Minecraft: MALfunction84

Posted 12 February 2011 - 06:55 PM

It's not finished yet. Plus, a screenshot doesn't capture the passage of time very well.
Posted Image Simulate the world while you sleep.

#4

  • Minecraft: NetBlitzer

Posted 12 February 2011 - 06:58 PM

You could use my craft grid to make it more realistic looking in the recipe?
Posted Image

#5

  • Location: Infesting the town of Ponyville.
  • Minecraft: Tassadaritze

Posted 12 February 2011 - 06:58 PM

NightmareX91 said:

Screenshots ingame or no download :3
You found a download link? GIMME!
Posted Image
Goodbye my old signature...

#6

Posted 12 February 2011 - 07:00 PM

Agreed. Either provide screenshots of the mod that you haven't finished, or I won't click the nonexistent download link and install it.
Posted ImagePosted ImagePosted Image

#7

Posted 12 February 2011 - 07:01 PM

This forum is literally full of the worst people, myself included.
Posted ImagePosted ImagePosted Image

#8

  • Location: USA
  • Minecraft: MALfunction84

Posted 12 February 2011 - 07:04 PM

I've updated the topic subject so it's clear that this mod is not finished.
Posted Image Simulate the world while you sleep.

#9

  • Location: USA
  • Minecraft: MALfunction84

Posted 12 February 2011 - 07:08 PM

NetBlitzer said:

You could use my craft grid to make it more realistic looking in the recipe?
I'm not sure I want it to be dependent on other mods. Also, this is my first foray into Minecraft modding. I don't want to overextend myself or it'll never get finished.
Posted Image Simulate the world while you sleep.

#10

  • Minecraft: Chris209

Posted 12 February 2011 - 07:12 PM

You should make a picture to put in our signatures for us to support it and to pass it around so everybody knows.
Posted Image

#11

Posted 12 February 2011 - 07:13 PM

Can't wait until its finnished!! :)
Posted ImagePosted ImagePosted Image

#12

    Tiramo

    Diamond Miner

  • Members
  • 862 posts
  • Location: Netherlands
  • Minecraft: Tiramo

Posted 12 February 2011 - 07:16 PM

Is something wrong with my eyes or do I see no download link...
Hmmm, maybe that creeper :D sees it, I'll ask it him,
.................
You know what's gonna happen next...
........... :Skeleton: .............
Well, I'll be off re-building my house...
We do what we must, because we can. Check our my Tekkit server!: mc3.rnplus.nl
Posted Image

#13

  • Minecraft: NetBlitzer

Posted 12 February 2011 - 07:19 PM

Make it a [WIP] instead of a [MOD]. That way, people won't be asking for download links always. And you will probably have to be dependent on modloader probably. People like it when things are compatible.
Posted Image

#14

  • Minecraft: Parablank

Posted 12 February 2011 - 07:33 PM

Suggestion:

Don't allow to spam sleep.
Nope.

#15

  • Location: USA
  • Minecraft: MALfunction84

Posted 12 February 2011 - 07:35 PM

NetBlitzer said:

Make it a [WIP] instead of a [MOD]. That way, people won't be asking for download links always. And you will probably have to be dependent on modloader probably. People like it when things are compatible.
Already done. Thanks.
Posted Image Simulate the world while you sleep.

#16

  • Location: USA
  • Minecraft: MALfunction84

Posted 12 February 2011 - 07:49 PM

Chris209 said:

You should make a picture to put in our signatures for us to support it and to pass it around so everybody knows.
Good idea. Here's an image I just threw together that you guys can use.
Posted Image
Posted Image Simulate the world while you sleep.

#17

  • Minecraft: Chris209

Posted 12 February 2011 - 08:00 PM

MALfunction84 said:

Good idea. Here's an image I just threw together that you guys can use.
Posted Image
Could you give us and url to put in our signature...
For Example: your signature (Like when you click on the picture it brings you to the thread)
If you don't understand look at my signatures. They are signatures of what I just said.(The thing about clicking on a picture and brings you to thread)
Posted Image

#18

Posted 12 February 2011 - 08:03 PM

Oh wow, you got me interested.
This totally isn't because I'm too lazy to actually let my crops grow.
Posted Image Posted Image

#19

  • Location: USA
  • Minecraft: MALfunction84

Posted 12 February 2011 - 08:04 PM

Chris209 said:

Could you give us and url to put in our signature...
For Example: your signature (Like when you click on the picture it brings you to the thread)
If you don't understand look at my signatures. They are signatures of what I just said.(The thing about clicking on a picture and brings you to thread)
Yeah, just use the URL for my initial post in this topic:
viewtopic.php?f=25&t=176264#p2546729
Posted Image Simulate the world while you sleep.

#20

  • Location: just dont turn around.
  • Minecraft: Derekjohn3

Posted 13 February 2011 - 12:10 AM

Great work dude but i will only download when i can wake voluntarily.