Designing the many Easter eggs of Zombie Army 4: Dead War
“Easter eggs” have become common in visual media, whether it’s film, television, or video games. Creators hide these bits of surprise in a way that’s findable to those with a keen eye and an appreciation for whatever the Easter egg makes reference to.
As games evolved over generations, the principle behind the Easter egg has grown exponentially, with more iterations on the concept appearing in modern video games.
One recently released game that leans into the idea of Easter eggs is Zombie Army 4: Dead War, Rebellion’s latest in the series, which maintains a cult following. Jordan Woodward, lead level designer at Rebellion, is no stranger to the implementation of secrets within the game world. Much of what infuses a sense of charm into the world of Zombie Army is the carefully positioned Easter eggs, which encourage players to carefully dissect each level. A conversation with Woodward gave insight into the process behind it all.
Within the early moments of Zombie Army 4, a small room presented a dead end with nothing of interest but a typewriter. With no other means of interactivity in the room, the typewriter beckons players to inspect it. Choose to do so and it will begin to type on its own accord — reeling off numerous horror movie quotes for the player. Then, as the player turns around, a greeting from several creepy dolls is glaring back at them, startling the player.
It’s a game series that’s built around the love and admiration of classic horror movies — especially the golden age of the genre.
“The franchise and universe of Zombie Army take a lot of inspiration from cult horror and 80s B-movie horror films and that vibe is definitely a big part of Zombie Army 4,” said Woodward. “They are genres a lot of the team are massive fans of, and they had a lot of fun coming up with references and Easter eggs from their favorite films to put in the game. We had feedback from our community, and this was one of the things people loved about the franchise, so it was an obvious fit for Zombie Army 4 too.”
Looking at player feedback and how the community reacts is an integral part of the process, as well as looking back at past installments. “Creating an engaging and intriguing world which players want to explore was at the core of designing the levels and lore within the game,” Woodward said. “The humor and tongue in cheek delivery of that additional layer was something previous Zombie Army games in the franchise were praised for and another reason our fans, and ourselves, loved the other games. We wanted to revisit this in Zombie Army 4, continuing with the trend of adding movie references and quirky Easter eggs to discover, to drive some more exploration and provide a few chuckles along the way.”
With so many different voices in the team at Rebellion, everyone had their own ideas for what to implement in the finished release. “A lot of the development team are big fans of the horror genre and we spent a lot of time watching cult zombie horror movies such as Dead Snow, Outpost, and Overlord – so naturally everyone jumped at the chance to get their favorite zombie and horror movie references in to Zombie Army 4.”
Having the player recognize these secrets isn’t integral to the experience. It was to be made clear that finding such extras was an extension to the overall experience. “It was also our aim to provide players with a layer of depth and environmental storytelling that is always present for the player to find but wasn’t crucial to the enjoyment of the game,” Woodward said. “It’s a game that doesn’t take itself too seriously, but lore-wise everything still makes sense within the world and story we’ve created.”
And that world is crafted around a love for horror movies with a vast array of inspirations. With examples stemming from influences such as The Shining, and the more recent Netflix show Stranger Things. In Zombie Army 4, the game references Stranger Things via an environmental puzzle: lights lay draped on the wall, each dangling beside a letter. Figuring out the correct sequence in which to shoot the lights rewards players with a locked safe opening, which is filled with an assortment of items to assist them on their quest.
When such a large team is working on a project of this magnitude, there must be a degree of preparation when it comes to implementation. The early stages of development called for the team to come together, collaborate on ideas, and see what sticks.
“In the pre-production stages of development and during development, we encouraged everyone from the team to submit as many ideas as they could for their favorite Easter eggs, movie references, horror references and even references from previous Rebellion games,” Woodward said.
With such a wealth of ideas coming from a large team, it’s no doubt that many would fail to see the light of day. Collectively discussing the plethora of concepts the team had brainstormed and choosing what to go forward with was a key aspect of the thought process.
“After we had collated a huge list of ideas, we started to look at which ones we wanted to take forward, prioritizing them and how and where we wanted to present them. Also, what would be the most fun way to discover it?” Woodward explained. “We then started to pin down the locations where we thought each of them would work well and the designers mocked them up in the levels using pre-made or whitebox assets and our in-house Asura Engine scripting tools for any triggering logic.”
While Zombie Army 4 is jam-packed with Easter eggs bursting from the seams, the development team still had plenty of ideas which inevitably were left unfinished. According to Woodward, this was the case with this development cycle.
“A few ideas had to be scrapped from the list,” he said, “mainly due to complexity or time it would have taken to create them as some would need bespoke complex animation sequences or custom art assets we didn’t have the time to make. Or we had to simplify the reference, using different assets we already had. A lot of the coolest ideas made it into the game, though.”
With so many hidden secrets packed into one game, a balancing act needs to be performed to ensure that they’re tucked away from the casual player, but not too obscure for the keen eyed. Often, the Easter eggs that lay dormant in Zombie Army’s world lay waiting at the end of offbeat tracks or incorporated into heavily decorated rooms, waiting for eagle eyed players to stumble across their presence.
“The design approach with Easter egg placement was to encourage curious exploration of the game world,” Woodward said. “Often, we didn’t want to lead players directly to them, as this may have caused an unwanted distraction from the main objective of the mission or an encounter, this being especially problematic in co-op.
“The balance was to create areas and paths that weren’t too far away from the main play areas and main paths, so players didn’t get lost and could always quickly find their way back to a fight. These additional areas helped add some extra depth to the world and make the world seem larger and more open to explore.”
Sometimes, the balancing act can be tricky business and finding that perfect contrast into seamlessly integrating Easter eggs into the world of Zombie Army isn’t as easy as it may seem.
“There were some tweaks we had to make to some of them to make them more obviously connected with a different part of the level,” Woodward said. “For example: the gas rats Easter egg in the Hellbase mission. During playtesting players weren’t getting the link between finding and killing the rats in the level to open a locked safe in the following room. We tweaked this and put tiny gas masks on the rats and a rack for tiny gas masks to hang on the wall in the safe room by the safe. A mask would be hung on the rack each time a rat was killed to show how many were found. It’s subtle, but it helped make the link.”
The sheer amount of creativity Woodward and the team put into Zombie Army is evident through the playful level design they’ve crafted. Much of the process has been rewarding, but Woodward has found the most enjoyable part being the developers’ playtesting sessions.
“What I’ve personally enjoyed most about seeing all the awesome Easter eggs, environmental storytelling pieces and references is the creativity and enthusiasm from the design team. Even now during internal play sessions the team are finding references in each other’s work they didn’t know about!”
Video: Designing great UI that helps immerse players in your game
In this 2018 GDC session, UI designer Steph Chow discusses how to embed a game’s world into its user interface, and how to strike the right balance between player immersion and player usability.
It was an intriguing talk that afforded attendees a fresh look at the ways in which game developers traditionally design UI, and offered practical advice for designing UI that reinforces the themes of your games and helps players stay immersed.
In addition to this presentation, the GDC Vault and its accompanying YouTube channel offers numerous other free videos, audio recordings, and slides from many of the recent Game Developers Conference events, and the service offers even more members-only content for GDC Vault subscribers.
Those who purchased All Access passes to recent events like GDC or VRDC already have full access to GDC Vault, and interested parties can apply for the individual subscription via a GDC Vault subscription page. Group subscriptions are also available: game-related schools and development studios who sign up for GDC Vault Studio Subscriptions can receive access for their entire office or company by contacting staff via the GDC Vault group subscription page.
Humble have just released a bundle targeted as musicians. The Humble Music Producer Bundle is a collection of sound banks and VSTs. As with all Humble Bundles it is organized into tiers:
1$ Tier
Angelicals
Frontier
AAS Player (Note, this is available free)
15$ Tier
Analog Essentials
UltraFX
Kitnetix
Journeys
20$ Tier
Strum Sessions
Lounge Lizard Sessions
Ultra Analog Session
This bundle gives you a key that you redeem as a single download from https://www.applied-acoustics.com/. As with all Humble Bundles you can decide how your money is allocated, between charity, the publisher, Humble and if you choose (and thanks if you do!) to support GFS if purchased using this link. You can learn more about this bundle including briefly seeing the 20$ Tier items in action in the video below.
Konami – which is now the custodian of the PC Engine brand following its purchase of Hudson Soft in 2011 – is perhaps a little late to the party with its take on the ‘micro-console’ concept that kicked off with the Nintendo Classic Edition a few years back. Since then, we’ve seen SNK, Sony and Sega all jump on board the retro money train, often with wildly varying degrees of success.
However, while the Neo Geo Mini and Mega Drive Mini both offered up a selection of games that will be familiar even to the most casual of retro gaming fans thanks to the fact they’ve been released (and re-released) on a wide range of digital storefronts over the past decade, the PC Engine Mini (alongside its western counterpart, the TurboGrafx-16 Mini) offers up a library of games that’s a little more off the beaten track. That’s not to say it lacks quality – quite the opposite, in fact – and with emulation expert M2 doing the heavy-lifting (just as it did with Sega’s micro-console) authenticity is assured.
However, while the PC Engine Mini is questionably home to some fine games, there’s no denying that it lacks the fame and recognition that have arguably made Nintendo’s NES and SNES Classic Editions so popular. With Nintendo, you know you’re getting Mario, Zelda, Metroid and much more besides, but if you stopped the average person in the street and asked them to pick their favourite PC Engine / TurboGrafx-16 releases, most wouldn’t even know what console you were talking about. Can Konami’s console overcome this thorny issue and establish itself as one of the best micro-consoles money can buy? While the western release of the console has been delayed by the recent coronavirus outbreak, we’ve been able to get our hands on a Japanese unit, so let’s find out.
Unlike Nintendo and Sega’s micro-consoles, the PC Engine range is perhaps a little less famous with the average gamer. A fruitful collaboration between Japanese software company Hudson Soft and Japanese electronics giant NEC, the PC Engine burst onto the scene in 1987, offering players a more powerful home system than the ageing (yet still dominant) Nintendo Famicom. With its faithful arcade ports and robust support from the likes of Konami, Namco and Taito, it quickly established itself as Japan’s second favourite games console – a position it would maintain even after Sega launched its technically-superior Mega Drive in 1988.
A dizzying array of hardware upgrades followed; the PC Engine was blessed with a CD-ROM add-on in 1988, and was given a ‘Pro’ overhaul before Pro consoles were even a thing when Hudson and NEC released the ill-fated SuperGrafx in 1989 (only six games were ever released for it, and two of those are included on the PC Engine Mini – Daimakaimura and Aldynes). The PC Engine was released in North America as the TurboGrafx-16 in 1989, which struggled to keep pace with Nintendo and Sega in what would become a memorable console war. Despite the name, the system is powered by an 8-bit Hudson-made HuC6280 CPU – however, the graphics processor is 16-bit, which is why PC Engine games look so much better than NES titles.
While it failed to make any real impression in North America, in its native Japan the PC Engine was still popular enough to keep Sega at bay and would benefit from several additional hardware refreshes; the PC Engine Duo would combine the base console with a CD-ROM drive and would be iterated upon twice with the Duo-R and Duo-RX, while the system’s power was augmented using ‘System Cards’, the most notable of which was the Arcade Card which enabled slick ports such as SNK’s Fatal Fury Special and Art of Fighting. There was even a low-cost, kiddie-friendly variant in the form of the bizarre-looking PC Engine Shuttle, and portable editions such as the PC Engine GT and PC Engine LT, the latter of which came with an eye-watering price tag.
The PC Engine would eventually be replaced by the PC-FX in 1994 – another joint venture between Hudson and NEC – but the system was a dismal failure and never made it out of Japan.
PC Engine Mini Review: The Hardware
The PC Engine Mini’s naming is slightly disingenuous because it’s not actually that much smaller than the real deal. The original PC Engine was famous for its diminutive size – it was much, much smaller than systems like the NES, Mega Drive and SNES – so it stands to reason that Konami (via Hori, which is handling the hardware side of things with this project) was always going to struggle to shrink it down any further for this 2020 edition. As it stands, the PC Engine Mini is around 25-30 percent smaller than the 1987 model, but it has the same kind of dimensions as the NES Classic, SNES Classic and Mega Drive Mini. In fact, having all of them on a shelf together looks pretty cool.
From the green power switch to the fact that the console even ships with the red ‘EXT BUS’ protective plastic cover on the back (which has to be removed to reveal the USB and HDMI ports), the PC Engine Mini is a close match to the system that revolutionized the Japanese home console market in the late ’80s. However, there are some notable differences; NEC’s branding is completely removed from both the system itself and the packaging. Konami’s purchase of the PC Engine brand has effectively erased NEC from the picture – which is a bit of a shame given the firm’s contribution to the system’s legacy, but understandable in the context of giant corporations gobbling up IP.
Also, some purists may be upset by the fact that there’s no HuCard slot on the console – where these credit card-sized games would be inserted on the original console is simply a blanked-off gap on the PC Engine Mini. This is a relatively minor cosmetic grumble, however, and naturally has no impact on the system’s functionality. If it does bother you, then you’ll be even more annoyed by the fact that the AV and power sockets on the sides are also blank.
The controller feels like a one-for-one match with the original and comes with a generous 3-metre cable. The rolling D-Pad is brilliant, as are the two face buttons. Sadly, there’s no autofire option, as was the case with the revised PC Engine controller released after launch (this was the pad that the TurboGrafx-16 launched with). There are two USB ports on the front of the console (the original PC Engine only had one) so two-player games don’t need any additional hardware. For games that support more than two players (Bomberman, we’re looking at you), you’ll need to purchase a special adapter.
The version we’re reviewing here is the Japanese model. The North American version is renamed TurboGrafx-16 and features a different case design, while the European variant is based on the CoreGrafx revision of the Japanese PC Engine.
PC Engine Mini Review: The Games
The PC Engine Mini range offers 58 games – that’s 34 Japanese titles and 24 TurboGrafx-16 (American) games – but some of these are actually duplicates. In some cases where both a Japanese and North American version exist, both versions are included. So, Nectaris is available in its Japanese form as well as Military Madness, the North American release – and these are listed as two separate games on the console’s menu. There are some exceptions – Soldier Blade is only included in its TG-16 form, despite a Japanese release existing – but in this case it matters little as the versions are identical between regions due to the lack of Japanese text.
While the lineup is very similar across the three available hardware variants, there are some differences; the Japanese console gets Tokimeki Memorial and Tengai Makyō II: Manji Maru, while Konami’s shooter Salamander is exclusive to the North American and European editions. The version of Splatterhouse present is also different depending on which model you have; the western versions have the censored North American release where Rick wears a red mask to make him look less like Friday the 13th’s Jason Voorhees, while the Japanese model has the original, uncensored version.
It’s also worth noting that some of the games – such as Soldier Blade – come with bonus versions based on the popular ‘Caravan’ events which toured Japan at the time. These versions are usually score-focused and have a strict time limit, and are accessed by holding down the ‘Select’ button while pressing ‘Run’ to boot the game.
With (almost) 60 games available, the PC Engine Mini arguably trumps its micro-console rivals in terms of pure volume of software, but that number doesn’t tell the whole story. While Nintendo and Sega’s machines benefited from the amazing depth and breadth of their respective libraries, the PC Engine can’t offer quite the same degree of quality. There’s no 2D platformer here that is even close to rivalling Super Mario Bros. 3, nor is there an RPG present that can match The Legend of Zelda: A Link to the Past. Likewise, there’s no side-scrolling fighter at all, which means the PC Engine Mini lacks an answer to the brilliant Streets of Rage 2 on the Mega Drive Mini. In terms of pure software quality, Nintendo and Sega won that war a long time ago.
However, it’s worth pointing out that several of the titles on the PC Engine Mini rank as some of the best of the era. Dracula X: Rondo of Blood is widely regarded as one of the best entries in the entire Castlevania series, while Ys Book I & II is a classic JRPG with glorious 2D cinematic scenes and an epic soundtrack. Daimakaimura – better known to western players as Ghouls ‘n Ghosts – is presented here in its SuperGrafx form, and is arguably one of the closest home ports available. Alien Crush is a brilliantly twisted take on pinball and a forerunner to the equally fantastic Devil’s Crush, and the caveboy Bonk – arguably the PC Engine’s most obvious rival to Mario and Sonic – appears in two excellent side-scrolling platformers.
However, where the PC Engine Mini truly shines is in its shooters. The original console was famous for its talent in this particular genre, and back in the day, import-savvy players debated endlessly over which console was best for this kind of intense experience – the PC Engine or the Sega Mega Drive. The system’s proficiency in this field is evidenced by the sheer volume of shooters present on this miniature re-release: Galaga ’88, Fantasy Zone, Dragon Spirit, Super Darius, Super Star Soldier, Aldynes, Seirei Senshi Spriggan, Spriggan Mark 2: Re-Terraform Project, Gradius, Gradius II: Gofer no Yabō, Star Parodier, Ginga Fukei Densetsu Sapphire, Psychosis, R-Type, Space Harrier, Cho Aniki, Lords of Thunder, Blazing Lazers / Gunhed, Air Zonk and Soldier Blade are the 20 shooters available here, which means that over a third of the console’s entire library is devoted to the genre (shamefully, the astounding Gate of Thunder didn’t make the cut).
Given the quality of the assembled blasters, it’s hard to complain; Seirei Senshi Spriggan, Ginga Fukei Densetsu Sapphire, Soldier Blade and Star Parodier alone would cost you thousands of dollars to acquire in their original forms. Even the more common examples – such as the peerless port of Irem’s R-Type which helped sell the PC Engine to the masses at launch – are well worth a play, making this system a shooter fan’s dream come true. However, if you’re not so keen on that genre, you may find that pickings are slimmer than you’d like.
Granted, RPG fans are well served with the aforementioned Ys: Book I & II, Dungeon Explorer, Cadash and Neutopia II (the latter being as close as PC Engine fans got to a Zelda on the system), and titles such as Moto Roader, Power Golf, Parasol Stars, Splatterhouse, Panic Bomber and the superb Bomberman ’94 offer some much-needed variety, but there are one too many duds on offer here for our liking. The Kung Fu – known in North America as China Warrior – impressed in the ’80s thanks to its massive, screen-filling sprites but in terms of gameplay, it’s a proper snore-fest and should have been omitted in favour of something more worthy. J.J. & Jeff is also a waste of space; while the Japanese original, Kato-chan & Ken-chan, is infamous for its toilet humour, it’s a dog of a game to play and the North American port is even less interesting as much of the amusing content is stripped out. Victory Run – viewed by some as the console’s answer to Out Run (which is ironic as the PC Engine actually got a port of Sega’s famous racer) – is similarly superfluous, and unless you have a real fondness for it, you’re unlikely to boot it up more than once. Why include these when titles like Gekibo: Gekisha Boy and Magical Chase are potential picks?
Then there’s the issue of Japanese text. The fact that the PC Engine Mini in all of its various guises includes Hideo Kojima’s seminal Snatcher is fantastic, but unless you can read Japanese, it’s going to be a closed book to you. The same can be said for Tokimeki Memorial, Tengai Makyō II: Manji Maru and Jaseiken Necromancer, all of which are dense RPGs which don’t feature an English language option because there never was one; they were exclusive to their native Japan back in the day.
In terms of emulation quality, everything is absolutely spot-on as far as we can tell – and that’s to be expected with M2 at the helm. The menus are animated neatly and look very similar to the ones seen on Nintendo’s Classic Editions and the Sega Mega Drive Mini (the latter of which was also handled by M2). The games are presented in two categories for each region, and switching between the two of them triggers a cool effect where the screen blinks off before switching over to the other menu, just like when you’d turn the original hardware off on your old-school CRT TV back in the day. Booting a game also triggers a cool animation which shows the HuCard or System Card being placed in a console, complete with authentic sound effects.
You have slots for save states and it’s possible to change the way the screen looks, too. Sadly, the CRT filter makes the image look very fuzzy, and when running with the default setup there’s an odd shimmering effect due to the fact that the pixels are being distorted slightly. Switch to pixel-perfect mode and this issue vanishes completely. There’s also a filter mode which plays the game via a PC Engine GT / TurobGrafx Express, which is really awkward but amusing all the same.
The PC Engine holds a special place in the hearts of many retro gamers, so it’s fantastic to see a micro-console hit the market which caters for this very specific niche. While the PC Engine Mini isn’t going to have the same widespread appeal as the SNES Classic or Mega Drive Mini, it’s nonetheless a welcome addition to this burgeoning sector of the games industry.
Sure, there are a few odd selections when it comes to the bundled software, but being able to play titles like Dracula X: Rondo of Blood, Seirei Senshi Spriggan, Soldier Blade, Splatterhouse, Parasol Stars, Ginga Fukei Densetsu Sapphire without having to remortgage your house is pretty special. M2’s emulation is as faultless as ever (shame about that CRT filter, mind) and if you’re a fan of the system already then this is perhaps going to rank as your favourite micro-console so far.
However, without a recognisable slate of characters like Mario, Sonic or Link to pull them in, total newcomers might be left wondering what all the fuss is about – which perhaps says more about the failure of the TurboGrafx-16 in the west than it does about the overall quality of the games. Outside of Japan, the PC Engine was always an acquired taste, so it’s actually rather fitting that the situation should remain largely unchanged in 2020.
Please note that some links on this page are affiliate links, which means if you click them and make a purchase we may receive a small percentage of the sale. Please read our FTC Disclosure for more information.
PlatinumGames rarely drops a lot of information at once, but when it does, it’s often big news. Over the past few months, it’s successfully funded a Kickstarter project for The Wonderful 101: Remastered, revealed Project G.G. – the powerful climax to the Hideki Kamiya superhero trilogy, confirmed there’ll be a new Tokyo Studio, and unveiled its next-generation game engine.
Now, we just need to know what its fourth and final surprise is. According to the Japanese company’s official website, all will be revealed at the start of next month on 1st April (yes, the date lines up with April Fool’s Day). Given what’s already been shared, there are a lot of possibilities. Could it be tied to something like Bayonetta or Viewtiful Joe? Tell us what you think below.
Posted by: xSicKxBot - 03-26-2020, 07:42 AM - Forum: Python
- No Replies
How to Get the Key with Maximum Value in a Python Dictionary?
I have spent my morning hours on an important mission. What is the cleanest, fastest, and most concise answer to the following question: How do you find the key with the maximum value in a Python dictionary? Most answers on the web say you need to use a library but this is not true!
Simply use the max function with the key argument set to dict.get:
income = {'Anne' : 1111, 'Bert' : 2222, 'Cara' : 9999999} print(max(income, key=income.get))
# Cara
The max function goes over all keys, k, in the dictionary income and takes the one that has maximum value after applying the income.get(k) method. The get() method returns the value specified for key, k, in the dictionary.
Play with it yourself in our interactive code shell:
Now, read the 4-min article or watch the short video to fully understand this concept.
What’s the Max Function in Python?
Most likely, you already know Python’s max(…) function. You can use it to find the maximum value of any iterable or any number of values. Here are a few examples using the max function without specifying any optional arguments.
# Key that starts with 'largest' letter of the alphabet
print(max(income))
# Mary # Largest value in the dictionary income
print(max(income.values()))
# 878000 # Largest value in the given list
print(max([1,4,7,5,3,99,3]))
# 99 # Compare lists element wise, max is first list to have a larger
# element print(max([1,2,3],[5,6,4]))
# [5, 6, 4] # Largest value in the given sequence of numbers
print(max(5,7,99,88,123))
# 123
So far so good. The max function is very flexible. It works not only for numbers but also for strings, lists, and any other object you can compare against other objects.
Now, let’s look at the optional arguments of the max function. One of them is 'key'. Let’s find out what it does.
How Does the Key Argument of Python’s max() Function Work?
The last examples show the intuitive workings of the max function: you pass one or more iterables as positional arguments.
Intermezzo: What are iterables? An iterable is an object from which you can get an iterator. An iterator is an object on which you can call the next() method. Each time you call next(), you get the ‘next’ element until you’ve got all the elements from the iterator. For example, Python uses iterators in for loops to go over all elements of a list, all characters of a string, or all keys in a dictionary.
When you specify the key argument, define a function that returns a value for each element of the iterable. Then each element is compared based on the return value of this function, not the iterable element (the default behavior).
We define a function inverse() that returns the value multiplied by -1. Now, we print two executions of the max() function. The first is the default execution: the maximum of the list [2, 4, 8, 16] is 16. The second uses key. We specify ‘inverse’ as the key function. Python applies this function to all values of [2, 4, 8, 16]. It compares these new values with each other and returns the max. Using the inverse function Python does the following mappings:
Original Value
Value after inverse() applied (basis for max())
2
-2
4
-4
8
-8
16
-16
Python calculates the maximum based on these mappings. In this case, the value 2 (with mapping -2) is the maximum value because -2 > -4 > -8 > -16.
Now let’s come back to the initial question:
How to Get the Key with the Maximum Value in a Dictionary?
We use the same example as above. The dictionary stores the income of three persons John, Mary, and Alice. Suppose you want to find the person with the highest income. In other words, what is the key with the maximum value in the dictionary?
Now don’t confuse the dictionary key with the optional key argument of the max() function. They have nothing in common – it’s just an unfortunate coincidence that they have the same name!
From the problem, we know the result is a dictionary key. So, we call max() on the keys of the dictionary. Note that max(income.keys()) is the same as max(income). To learn more about dictionaries, check out our article Python Dictionary – The Ultimate Guide.
However, we want to compare dictionary values, not keys. We’ll use the key argument of max() to do this. We must pass it a function but which?
To get the value of 'Anne', we can use bracket notation – income['Anne']. But bracket notation is not a function, so that doesn’t work. Fortunately, income.get(‘Anne’) does (almost) the same as income['Anne'] and it is a function! The only difference is that it returns None if they key is not in the dictionary. So we’ll pass that to the key argument of max().
income = {'Anne' : 1111, 'Bert' : 2222, 'Cara' : 9999999} print(max(income, key=income.get))
# Cara
How to Get the Key with the Minimum Value in a Dictionary?
If you understood the previous code snippet, this one will be easy. To find the key with minimum value in the dictionary we use the min() function.
income = {'Anne' : 1111, 'Bert' : 2222, 'Cara' : 9999999} print(min(income, key=income.get))
# Anne
The only difference is that we use the built-in min() function instead of the built-in max() function. That’s it.
Find the Key with the Max Value in a Dictionary – Alternative Methods
There are lots of different ways to solve this problem. They are not as beautiful or clean as the above method. But, for completeness, let’s explore some more ways of achieving the same thing.
In a StackOverflow answer, a user compared nine (!) different methods to find the key with the maximum value in a dictionary. Here they are:
# Convert to lists and use .index(max())
def f1(): v=list(income.values()) k=list(income.keys()) return k[v.index(max(v))] # Dictionary comprehension to swap keys and values
def f2(): d3={v:k for k,v in income.items()} return d3[max(d3)] # Use filter() and a lambda function
def f3(): return list(filter(lambda t: t[1]==max(income.values()), income.items()))[0][0] # Same as f3() but more explicit
def f4(): m=max(income.values()) return list(filter(lambda t: t[1]==m, income.items()))[0][0] # List comprehension
def f5(): return [k for k,v in income.items() if v==max(income.values())][0] # same as f5 but remove the max from the comprehension
def f6(): m=max(income.values()) return [k for k,v in income.items() if v==m][0] # Method used in this article
def f7(): return max(income,key=income.get) # Similar to f1() but shortened to 2 lines
def f8(): v=list(income.values()) return list(income.keys())[v.index(max(v))] # Similar to f7() but use a lambda function
def f9(): return max(income, key=lambda k: income[k]) print(f1())
print(f2())
print(f3())
print(f4())
print(f5())
print(f6())
print(f7())
print(f8())
print(f9())
# Cara (all outputs)
In a benchmark performed on a large dictionary by the StackOverflow user, f1() turned out to be the fastest one.
So the second best way to get the key with the maximum value from a dictionary is:
income = {'Anne' : 1111, 'Bert' : 2222, 'Cara' : 9999999} v=list(income.values())
k=list(income.keys())
print(k[v.index(max(v))])
# Cara
Find Key with Longest Value in Dictionary
We know how to find the maximum value if the values are numbers. What about if they are lists or strings?
Let’s say we have a dictionary that records the number of days each person worked this month. If they worked a day, we append 1 to that person’s list. If they didn’t work, we don’t do anything. At the end of the month, our dictionary looks like this.
The total number of days worked each month is the length of each list. If all elements of two lists are the same (as is the case here), they are compared based on their length.
# Length 2 is less than length 4
>>> [1, 1] < [1, 1, 1, 1]
True
So we can use the same code we’ve been using in the article to find the key with the maximum value.
>>> max(days_worked, key=days_worked.get) 'Cara'
If we update our dictionary so that Bert has worked the most days and apply max() again, Python returns ‘Bert’.
>>> days_worked = {'Anne': [1, 1, 1, 1], 'Bert': [1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1], 'Cara': [1, 1, 1, 1, 1, 1, 1, 1]} # Bert has now worked the most
>>> max(days_worked, key=days_worked.get)
Find Key With Max Value in a List of Dictionaries
Let’s say we have 3 dictionaries containing income information. We want to find the key with the max value from all 3 dictionaries.
We can see that ‘Igor’ has the highest income so we expect that to be returned.
There are several ways to do this. The simplest is to put all key-value pairs into one dictionary using a for loop. Then we call max() as usual.
# Initialise empty dict
>>> big_dict = {} # Use for loop and .update() method to add the key-value pairs
>>> for dic in list_of_dicts: big_dict.update(dic) # Check the result is as expected
>>> big_dict
{'Anne': 1111, 'Bert': 2222, 'Cara': 3333, 'Dani': 4444, 'Ella': 5555, 'Fred': 6666, 'Greg': 7777, 'Hope': 8888, 'Igor': 999999999999} # Call max() and specify key argument
>>> max(big_dict, key=big_dict.get) 'Igor'
Where to Go From Here?
Every Python master must know the basics. Improving your basic code understanding skills by 20% will improve your productivity by much more than anything else. Why? Because everything else builds upon the basics.
But most material online is tedious and boring. That’s why I’ve written a new and exciting way of learning Python, while measuring and comparing your skills against other coders. Check out the book “Coffee Break Python”. It’s LeanPub 2019 bestseller in the category Python!
Preliminary iPad Pro teardown reveals smaller battery, LiDAR Scanner
By Mikey Campbell Wednesday, March 25, 2020, 11:08 pm PT (02:08 am ET)
A teardown of Apple’s 2020 iPad Pro posted to YouTube on Wednesday offers an initial, albeit cursory, look at the new tablet’s internal design and component loadout, which is nearly identical to 2018’s model.
Conducted by YouTube channel EverythingApplePro, the disassembly reveals little in the way of new information.
The new 2020 11-inch iPad Pro is fed by a 7,540 watt-hour battery split into two cells, a slight decrease from the 7,812 watt-hour unit provided in the 2018 version. While the video fails to take precise measurements, one cell appears to be slightly shorter than the other, likely a design decision to accommodate the new iPad Pro’s enlarged camera array.
Moving to said camera, the 2020 variant sports a dual-camera setup with one 10-megapixel module serviced by an ultra-wide lens and a 12-megapixel module topped with Apple’s standard wide lens.
New for iPad, and indeed any Apple product, is the LiDAR Scanner, which consists of two lens-capped modules, one stacked atop the other. The system has not been detailed in full, but the parts in view are likely a a VSCEL transmitter and receiving sensor. The pair work together to create depth maps by measuring the time it takes pulses of light to travel to and from a target surface.
Interestingly, the entire package — dual-cameras and LiDAR Scanner — is more compact than the triple-lens unit deployed in iPhone 11 Pro. Current rumors suggest Apple will build its ToF technology into a next-generation “iPhone 12” this year, potentially resulting in a a triple- or quad-module arrangement, depending on handset model.
[embedded content]
The front side of the logic board, which was not removed from during the teardown, appears almost identical to the circuit board found in 2018’s tablet, save for a swap to Apple’s A12Z processor. There are a few minor changes, like redesigned power and data connectors, and what could be the replacement of a chip identified in 2018 as “343S00248-A0 1835NHGY.”
As illustrated by a now obligatory bend test, iPad Pro unsurprisingly buckles when enough force is exerted on the thin aluminum chassis. The perfunctory overview shows no structural enhancements were added to the tablet.
Whether this year’s iPad Pro suffers from the same out-of-the-box bend as its predecessor is unknown. Apple last year said “some” units shipped out with a slight curvature at or near the dielectric antenna “lines” that trace their way around cellular-capable versions of the device. Following customer complaints, the company issued a statement on the matter, saying its engineering tolerances allow for a deviation of no more than 400 microns across any one side.
AppleInsider is currently evaluating the 2020 iPad Pro and will have much more on the tablet this week.
Posted by: xSicKxBot - 03-26-2020, 07:40 AM - Forum: Windows
- No Replies
Sea of Thieves turns 2: How many of the 38 additions have you tried?
A lot has changed in Sea of Thieves since Rare’s shared world pirate fantasy first set sail in March 2018. Thanks to a series of major content updates in the first year – including the game-changing Anniversary Update – and a recent commitment to regular monthly updates, the game has grown and evolved at a scale that few other service-based games can match. Even better, all content has been added for free!
To celebrate the game’s second anniversary, here are 38 of the biggest things that have been added over the past two years. If you’re yet to try the game or haven’t played for a while, be sure to jump in by trying it out with Xbox Game Pass or buying the game on the Microsoft Store or your local retailer. Sea of Thieves’ uniquely horizontal progression system means that you can set sail again at any time and not be at a disadvantage against other players.
1) Tall Tales Tall Tales are Sea of Thieves’ unique take on a story-driven campaign, offering cinematic quests within the game’s emergent shared world. The first collection of stories, Shores of Gold, take players on an epic adventure in search of a lost island and magical treasure, while recent additions ‘The Seabound Soul’ and ‘Heart of Fire’ tell a whole new story. Available to solo players or crews of any size, there are eleven Tall Tales in total which should keep you occupied for up to 30 hours.
2) The Arena Added as part of 2019’s mega Anniversary Update, The Arena is a standalone competitive game mode that lets crews battle it out in fixed-length contests described by Eurogamer as “glorious, consequence-free PvP carnage”. The Arena also features its own Trading Company – the Sea Dogs – with which you can earn reputation and rise in rank, together with its own social space and cosmetic rewards.
3) The Megalodon The game’s first Megalodon – think Jaws on steroids – was added to the game in its first major content update, The Hungering Deep. This fearsome giant shark was an emergent threat that could attack ships at any time, with rewards for crews who could defeat it. It was later followed to the Sea of Thieves by many dangerous Megalodon variants, including rare species like the legendary Shrouded Ghost.
4) The Devil’s Roar The Devil’s Roar is a wild and dangerous world region that was added to the game with the Forsaken Shores content update (wonderfully brought to life by actor and comedian Matt Berry). This world region is full of natural perils including volcanoes, lava, geysers and superheated water. So dangerous is The Devil’s Roar that its Ashen treasures deliver sizeable gold and reputation gains when cashed in.
5) Skeleton Ships The introduction of Skeleton Ships in July 2018 changed the game by allowing players to engage in ship-to-ship combat outside of PvP. These fearsome sea-based threats can be found sailing beneath the ship-shaped cloud, and can burst from beneath the waves without warning to ambush unsuspecting pirates. Sink them and take their treasure!
6) Fog Providing the ‘Shrouded’ bit of November 2018’s Shrouded Spoils content update, fog brought both atmosphere and gameplay depth. Exploring islands in thick fog adds an additional layer of threat and complexity, while clever captains can use the swirling mists to hide their ships from other crews…
7) Maiden Voyage The Maiden Voyage is a tutorial that goes the extra mile. Set just outside Sea of Thieves’ shared world, the Maiden Voyage is the perfect opportunity for new pirates to find their sea legs in a safe space. And while it’s perfect for new players wanting to learn how to play, it also offers plenty for more experienced players including a chance to meet the Pirate Lord himself and earn some exclusive cosmetics.
8) Fire The addition of fire turned up the heat on players when it was added to the game last November. Fires can be started by firebombs, angry Chests of Rage or through less aggressive means, such as leaving food on the ship’s stove unattended. One thing’s for sure, fire had a huge impact on the game and proved that Alfred Pennyworth was right when he observed: “Some men just want to watch the world burn.”
9) Lots of lovely emergent loot Back at launch, finding treasure could be a difficult business. But these days the Sea of Thieves is positively awash with loot, with Barrels of Plenty (floating barrels of bonus treasure), emergent Skeleton Captains, increased shipwreck loot, Mermaid Statues and their valuable gems, treasure maps in barrels, more washed-up treasure and rewards for defeating the Megalodon, Kraken and Skeleton Ships.
10) Fishing People asked. And asked. And asked some more. So as part of the Anniversary Update, Rare added a huge fishing mechanic to the game that offers hours of distraction from epic adventuring. There are 10 main types of fish, each with their own variants, some of which can only be caught in specific world regions with the right bait and conditions. You can cook and eat fish to restore health, or cash them in with The Hunter’s Call Trading Company found at any Seapost. Sea of Thieves’ fishing was the highest-rated experience in PC Gamer’s article ‘Which PC game has the best fishing?’.
11) The Hunter’s Call Trading Company Headed by the lovable Merrick (of The Hungering Deep fame), The Hunter’s Call is a Trading Company that rewards players for catching and cooking fish or meat. Unique among Trading Companies in that its representatives are located at Seaposts rather than Outposts, The Hunter’s Call offers a more leisurely path to Pirate Legend status.
12) Cargo Runs Introduced to the game back in the Forsaken Shores update, Cargo Runs are a twist on the standard Merchant Alliance quest. Collect and deliver valuable cargo to various locations across the Sea of Thieves, both on time and in good condition, for a handsome payday.
13) Legends of the Sea Sea of Thieves’ world has always contained Easter eggs that celebrate the stories of our most legendary players. Umbra’s sidequests, introduced in January 2020’s Legends of the Sea update, offer players the chance to earn Commendations and Doubloons for tracking down the stories behind these inspiring and entertaining player immortalisations.
14) Fort of the Damned Raiding Skeleton Forts has always been an essential part of the Sea of Thieves experience, but the Fort of the Damned is a standout encounter. Released in time for Halloween 2019, this spooky Fort represents a major upgrade on the raid experience, both in terms of challenge and reward. Unlike other Forts, the Fort of the Damned can be activated on demand by crews who want to unlock its treasures again and again.
15) Gunpowder Skeletons First came skeletons. Then skeletons with weapons (including snipers and cannoneers). But things got serious once the skeletons of the Sea of Thieves discovered that Gunpowder Barrels also make very effective weapons. Boom!
16) Stronghold Kegs Available through raiding Forts, Stronghold Kegs are Gunpowder Barrels that make a really big bang (colloquially known as “mega-kegs”). These rare items command a high price from the Merchant Alliance, or they can be used as devastating weapons against all manner of enemies…
17) Reaper’s Chests Reaper’s Chests are high-value chests found emergently in shipwrecks across the Sea of Thieves, and reveal their location through a mysterious beacon that rises up to the sky. But beware – once a Reaper’s Chest is recovered, other crews will be able to see on the map that you have this valuable reward and can hunt you down.
18) Pets Every pirate needs an animal companion. The Pirate Emporium, added to the game in September 2019, brought with it a range of lovable pet parrots and monkeys, with more types still to come. Available in various breeds and colours, pets can also be dressed up in costumes for added hilarity. These furry and feathered sidekicks are an essential addition to any crew.
19) More than 100 new emotes Emotes have always been a popular way for players to express themselves, but the addition of the Pirate Emporium has seen more than 100 new emotes added to the game. From the classic “we’re flying” emote inspired by a certain sea-based movie to the infamous “Crab Dab”, there’s something for every pirate and every situation.
20) Cursed Cannonballs Introduced to the game as part of July 2018’s Cursed Sails update, Cursed Cannonballs are powerful weapons that can be found emergently in the world. Each of the eleven types of Cursed Cannonballs imparts a powerful, time-limited effect on an enemy, from making them dance to rendering their cannons impotent.
21) Cooking Not only did the Anniversary Update bring fishing and hunting to the game, it brought cooking to legions of hungry pirates. Food can be cooked using the stove aboard every ship or at campfires. Once perfectly prepared, cooked food can be eaten to restore health or sold to The Hunter’s Call for a premium.
22) The Bilge Rats The Bilge Rats are an unofficial Trading Company who arrived in Sea of Thieves in summer 2018. Dedicated to celebrating a pirate’s life of adventure outside the traditional Trading Companies, Duke and his motley crew give players a range of regular sidequests which can unlock additional rewards and cosmetics.
23) Alliances Sometimes it can be Sea of Friends, thanks to the Alliance feature that lets two or more crews team up to improve the odds and share the rewards. Perfect for pirates looking to earn loot in a hurry, and a great way to meet other players and make friends.
24) Creator Crew With its emphasis on player freedom and creativity, Sea of Thieves is a hugely watchable game. The Creator Crew is a programme which helps budding streamers and YouTubers get noticed, offering asset packs, opportunities to have work shared across official channels and ‘How To’ tutorials for improving content. What’s more, there’s also the chance to unlock exclusive cosmetic items by completing creator challenges. Go create and share your pirate stories!
25) Brigantines Another feature that was introduced in the Cursed Sails update, the Brigantine is a ship type made for three players. More agile than a Galleon but boasting significantly more firepower than a Sloop, Brigantines soon became a player favourite.
26) Rowboats Originally introduced in the Forsaken Shores update as a tool to deal with the superheated waters of the volcanic Devil’s Roar region, Rowboats are perfect for pirates looking to move around more loot than they can carry or sneak up on larger ships undetected. Racing them can also be fun!
27) The Harpoon Every ship – and even some Rowboats – now come equipped with harpoon guns. These handy tools can be used in lots of ways, from plucking resources out of the water to making a sharp turn around an island. They can also be used to steal treasure from unsuspecting pirates in what has become known within the community as a ‘zoink’.
28) Doubloons and the Black Market The arrival of the Bilge Rats on the Sea of Thieves also introduced a brand new currency which could be earned for completing time-limited events, a range of sidequests or by unlocking certain Commendations. Once earned, valuable Doubloons can be exchanged for rare cosmetics through the Black Market, or used to buy favour with the main Trading Companies and level up faster.
29) Seaposts Dotted around the Sea of Thieves, Seaposts are mini-Outposts. They offer crews a great opportunity to stock up on resources, plus you’ll find traders who’ll sell a variety of cosmetics at a discount. Seaposts are also home to The Hunter’s Call, so they’re where you need to go to sell fish and meat.
30) Chest of Rage Added recently in February 2020, the Chest of Rage is the latest Cursed Chest to be found within the game. These rare and valuable chests are filled with fury which vents itself regularly if not kept cool, making this a high-risk (but high-return) item which can also double up as a powerful weapon…
31) Collector’s Chests Originally introduced as part of Tall Tales: Shores of Gold, Collector’s Chests – chests that can be opened and will hold whatever treasure you put in – have recently been added as rewards for solving riddle quests. What does that mean? More loot!
32). Tucking Tucking, you say? What on earth is that? Let us explain. Pioneered by several high-profile streamers, ‘tucking’ in Sea of Thieves involves using emotes such as sleeping and sitting to hide aboard other players’ ships (the emote hides the gamertag above a player). Opening up a stealthy – not to mention hilarious – new way to play the game, tucking was officially recognised by the addition of a number of hide emotes to the Pirate Emporium (one of which is available to players for free).
33) Expanded ship customization Having a cool-looking ship is one of the best parts of Sea of Thieves. Every pirate takes pride in how their vessel looks, plus a ship’s visibility from distance means that it’s your calling card in the world. Since the Shrouded Spoils expansion, players can now determine all elements of how their ship looks including the sails, figurehead, hull, capstan, cannons, wheel and flag. Get customising!
34) Skeleton variety While the principal threat on land for pirates remains skeletal in nature, the threat has expanded through the addition of a number of skeleton variants – such as Gold, Plant, Shadow and Ashen – that each pose a different challenge. What’s more, you’ll also run into Skeleton Captains (and their crews) around the world, and may even encounter a fearsome Skeleton Lord…
35) Speaking Trumpet The Speaking Trumpet is a handy tool for anyone looking to communicate with another crew. Kind of like a pirate-themed megaphone, the Speaking Trumpet amplifies the distance over which voice and text chat can be heard by other crews. Perfect for communicating with other ships without getting too close (just in case).
36) Throwable weapons Throwable weapons offer more combat variety and come in two main flavours. Firebombs, as the name suggests, explode on impact and set fire to anything and anyone in the vicinity. Blunderbombs are closer in style to a grenade, dealing damage to (and knocking back) anyone in their blast radius.
37) Chainshot Another new game feature added just this March, chainshot is a new ammo type that can be loaded into cannons and used to take down another ship’s mast. Bringing more tactical depth to ship-to-ship combat, there’s nothing more satisfying than felling another ship’s mast in a single shot.
38) Another 1200 gamerscore Last but not least, the ever-expanding quantity of content in Sea of Thieves has also meant the addition of hundreds of new achievements and another 1200 gamerscore to play for (making a total of 2200 in all).
And there’s more! We haven’t even mentioned combat improvements, new musical instruments and more shanties to enjoy, hundreds of extra cosmetic items, a wealth of new Commendations or the countless ongoing quality of life improvements across all areas of the game. Visit the official Sea of Thieves website to see more about the latest updates, and for the latest on all things Xbox stay tuned to Xbox Wire.
The Xenoblade Chronicles Developer Monolith Soft Now Has 243 Employees
Monolith Soft has grown in strength and size ever since it was acquired by Nintendo in 2007. In recent years, it helped with the landscape design in The Legend of Zelda: Breath of the Wild and its definitive edition of the original Xenoblade Chronicles is expected to be released on the Switch at some point this year. It’s also assisting with the sequel to Breath of the Wild and working on a new RPG.
As a result of all these projects, it’s been on a non-stop recruitment drive for a number of years now. It ramped up its studio size to 120 employees in 2014 and last year was busy hiring staff for Breath of the Wild 2. Now, Silconera reports Monolith Soft has grown to 243 employees – that’s its highest employee count to date.
If all this has you wondering where Xenoblade Chronicles: Definitive Edition is, in the past few weeks it’s been listed for a May 29th launch by multiple online retailers. In saying this, Nintendo has made no official announcement about when the game will be released just yet, so there’s no certainty it will be launched in this particular month.